infinety-es/nova-filemanager

1.1.1 2018-10-09 08:24 UTC

README

Latest Version on Packagist CircleCI branch StyleCI Total Downloads

A Filemanager Tool and Field for Laravel Nova

Filemanager Tool preview

FileManager Tool

Filemanager Field preview

FileManager Field

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require infinety-es/nova-filemanager

Next up, you must register the tool with Nova. This is typically done in the tools method of the NovaServiceProvider.

// in app/Providers/NovaServiceProvider.php

// ...

public function tools()
{
    return [
        // ...
        new \Infinety\Filemanager\FilemanagerTool(),
    ];
}

Nova Filemanager works with Laravel Flysystem. Default disk is public. You can change the Flysystem disk writing that line in your env. file:

FILEMANAGER_DISK=public

Tool Usage

Click on the "FileManager" menu item in your Nova app to see the Filemanager Tool

Field Usage

use Infinety\Filemanager\FilemanagerField;

FilemanagerField::make('field');


// You can set also if you want preview Images in Index and Detail views

FilemanagerField::make('field')->displayAsImage();

From version v1.1.1 you can also use the folder option to set a initial folder of your field.

FilemanagerField::make('field')->folder('avatars');
//or
FilemanagerField::make('field')->displayAsImage()->folder('files/avatars');

Localization

Set your translations in the corresponding xx.json file located in /resources/lang/vendor/nova

...

    "Filemanager": "Gestor de archivos",
    "Create folder": "Crear carpeta",
    "Write a folder name": "Escribe el nombre de la carpeta",
    "Create": "Crear",
    "Creating": "Creando",
    "Cancel": "Cancelar",
    "The folder name is required": "El nombre de la carpeta es requerido",
    "Folder created successfully": "Carpeta creada correctamente",
    "Error creating the folder": "Error al crear la carpeta",
    "Preview of": "Vista previa de",
    "Name": "Nombre",
    "Mime Type": "Tipo de archivo",
    "Last Modification": "Última modificación",
    "Size": "Tamaño",
    "Dimensions": "Dimensiones",
    "Url": "Enlace",
    "Copy": "Copiar",
    "Select file": "Seleccionar archivo",
    "Remove File": "Eliminar archivo",
    "Are you sure?": "¿Estás seguro?",
    "Removing...": "Eliminando...",
    "Text copied to clipboard": "Texto copiado al portapapeles",
    "File removed successfully": "Archivo eliminado correctamente",
    "Error removing the file. Please check permissions": "Error al eliminar el archivo. Por favor, comprueba los permisos",
    "Home": "Inicio",
    "You don\\'t have permissions to view this folder": "No tienes permisos para ver esta carpeta",
    "No files or folders in current directory": "Esta carpeta esta vacía",
    "Remove directory": "Eliminar carpeta",
    "Folder removed successfully": "Carpeta eliminada correctamente",
    "Error removing the folder. Please check permissions": "Error al eliminar la carpeta. Por favor, comprueba los permisos",
    "Upload": "Subir",
    "Error on upload": "Error al subir",
    "Success": "Éxito",
    "Error uploading the file. Check your MaxFilesize or permissions": "Error al subir el archivo. Comprueba la directiva MaxFilesize o los permisos",
    "Select a file": "Selecciona un archivo",
    "Open FileManager": "Abrir Gestor de archivos",
    "This image": "Esta imagen",
    "could not be found.": "no se encuentra.",
    "Delete": "Eliminar",
    "Deselect File": "Deseleccionar archivo",
    "Are you sure you want to deselect this file?": "¿Estas seguro de querer deseleccionar este archivo?",
    "Remember: The file will not be delete from your storage": "Recuerda: El archivo no será eliminado de tu disco",
    "Deselect": "Deseleccionar"

Testing

composer test
yarn lint
yarn check-format

ToDo

  • AWS S3 support
  • Different upload method
  • Grid / List views
  • FIles actions

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Infinety - Calle Comedias, 8 Floor 3, Suite 5 46003 Valencia (Spain).

Credits

License

The MIT License (MIT). Please see License File for more information.