Advanced File Manager is a powerful and flexible Laravel package designed to streamline file management in your applications. Easily manage, organize, and handle files with a seamless integration for enhanced functionality.
- 📁 Easy file and folder management
- 🖼️ Image preview and thumbnail generation
- 📋 Copy, cut, paste operations
- 🗑️ Soft delete with trash management
- 📤 File upload with drag and drop support
- 📎 Multiple file upload
- 🔍 Advanced file search and filtering
- 📱 Responsive design
- 🔒 File access permissions
- 💾 Multiple storage disk support
First, install the package via Composer:
composer require devrabiul/advanced-file-manager
Then publish the package resources by running:
php artisan vendor:publish --provider="Devrabiul\AdvancedFileManager\AdvancedFileManagerServiceProvider"
After publishing the assets, you can find the configuration file at config/advanced-file-manager.php
. Here you can customize:
- Maximum upload file size
- Allowed file types
- Storage disk settings
- Thumbnail settings
- Access permissions
- Route prefix
Add the following includes to your blade template:
- Add the styles in your
<head>
section:
{!! AdvancedFileManager::styles() !!}
- Add the file manager component where you want it to appear:
{!! AdvancedFileManager::content() !!}
- Add the scripts before closing
</body>
tag:
{!! AdvancedFileManager::scripts() !!}
You can customize the file manager by passing parameters:
@include('advanced-file-manager::file-manager', [
'disk' => 'public',
'maxFileSize' => 10240, // in KB
'allowedFileTypes' => ['image/*', 'application/pdf'],
'showThumbnails' => true
])
// Upload file
FileManager::upload($file, $path);
// Create directory
FileManager::createDirectory($name, $path);
// Move file
FileManager::move($source, $destination);
// Copy file
FileManager::copy($source, $destination);
// Delete file/folder
FileManager::delete($path);
// Get file details
FileManager::getFileInfo($path);
// List directory contents
FileManager::listContents($path);
// Search files
FileManager::search($query, $path);
The package dispatches various events that you can listen to:
FileUploaded
FileDeleted
DirectoryCreated
FileMoved
FileCopied
The package includes built-in security features:
- File type validation
- Size restrictions
- Malware scanning (optional)
- User authentication integration
- Custom middleware support
Common issues and solutions:
-
Permission Issues
- Ensure proper directory permissions (usually 755 for folders and 644 for files)
- Check storage link creation:
php artisan storage:link
-
Upload Problems
- Verify PHP upload limits in php.ini
- Check maximum file size configuration
-
Display Issues
- Clear browser cache
- Run
php artisan view:clear
- Ensure all assets are published
Contributions are welcome! Please see CONTRIBUTING.md for details.
This package is open-sourced software licensed under the MIT license.