File manager dependency for Laravel Enso.
click on the photo to view a short demo in compatible browsers
- provides a generic approach when working with files through using a
- package comes with a
HasFiletrait that can be added to models who work with files
- has utility classes for the upload, download, inline-opening and deletion of files
- on upload, performs validation of the file and checks the extension and the mime type
- handles the optimization and resize for the supported image file types
- for upload and deletion, the changes are committed only if the filesystem operation was successful
- works with a
FileUploaderVueJS component that handles the selection of files and POSTs them to the specified route
- uses a policy to restrict access/changes to files that don't belong to the respective user
- provides a unified interface where you can view all the files you are working with, that you have access to, as well as search and filter them
- the types of files that are visible in the interfaces are configurable
- offers a configurable storage size limit
To use any of the three packages above, you don't need to do any extra work under the hood.
Until now, you could not see all your files in one place or find out how much space they occupied, as you could have had files uploaded through the documents manager, attached to various models in different places in the app, import files resulted out of your import operations and more.
You can now use the files menu to review, download search through and even delete them.
When adding or extending the file operations functionality it is strongly recommended that you use the
File model as well as the
accompanying traits and classes - see more bellow.
- holds some low-level properties pertaining to the file
- uses a polymorphic relationship to link to any other model
- a separate model instance is used for each file
- should not be used directly but through its chaperone model
- defines a series of methods that need to be implemented by the chaperone model (example: Document)
- the methods have a default implementation found in the
- of course, if required, even if using the trait, the methods may be overridden for specific scenarios
- provides a default implementation for the
- uses the
FileManagerclass when performing file operations
- can optionally use a set of properties to perform additional operations
- note that if you want to conditionally override a property value, or read it from the project configuration, you will need to override the corresponding method
$folder, string, if given, that
storage/app/folder is used for file operations | default is 'files'
$mimeTypes, array, if given, the mime types list is used to validate files against | default is 
$extensions, array, similar to mime types, is used for validation of the extension | default is 
resizeImages, array, if given, should contain the W-H values for resizing | default is 
$optimizeImages, boolean, if true, image optimization is performed | default is false
- is thrown when the any of the validations fail (file, extension, mime type)
- within the
visiblekey, contains a list of models that should be visible in the Files menu. The key will be used for the tab name while the fully qualified class name value is used to populated the list of files in the interface.
config/enso/files.php configuration file, lets you customize the following:
visible, key value array, a list of class-names for models that have files and should be present in the file manager list.
storageLimit, number, the storage size limit for the files functionality | default is
Note: the 'visible' models need to implement the
VisibleFile interface, by providing an implementation for the
php artisan vendor:publish --tag=filemanager-assets- the JS asset files
php artisan vendor:publish --tag=enso-assets- a common alias for when wanting to update the JS assets, once a newer version is released
php artisan vendor:publish --tag=enso-config- a common alias for when wanting to update the configuration files, once a newer version is released
php artisan vendor:publish --tag=filemanager-config- publishes the file manager configuration file
The Laravel Enso Core package comes with this package included.
- VueComponents for the accompanying VueJS components