Skip to content

Advanced File Manager is a powerful Laravel package for organizing files easily, with no jQuery, Bootstrap, or Tailwind dependency. Use it anywhere.

Notifications You must be signed in to change notification settings

devrabiul/advanced-file-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced File Manager

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.

Features

  • 📁 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

Installation

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"

Configuration

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

Usage

1. Basic Setup

Add the following includes to your blade template:

  1. Add the styles in your <head> section:
{!! AdvancedFileManager::styles() !!}
  1. Add the file manager component where you want it to appear:
{!! AdvancedFileManager::content() !!}
  1. Add the scripts before closing </body> tag:
{!! AdvancedFileManager::scripts() !!}

2. Custom Implementation

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
])

Available Methods

File Operations

// 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);

File Information

// Get file details
FileManager::getFileInfo($path);

// List directory contents
FileManager::listContents($path);

// Search files
FileManager::search($query, $path);

Events

The package dispatches various events that you can listen to:

  • FileUploaded
  • FileDeleted
  • DirectoryCreated
  • FileMoved
  • FileCopied

Security

The package includes built-in security features:

  • File type validation
  • Size restrictions
  • Malware scanning (optional)
  • User authentication integration
  • Custom middleware support

Troubleshooting

Common issues and solutions:

  1. Permission Issues

    • Ensure proper directory permissions (usually 755 for folders and 644 for files)
    • Check storage link creation: php artisan storage:link
  2. Upload Problems

    • Verify PHP upload limits in php.ini
    • Check maximum file size configuration
  3. Display Issues

    • Clear browser cache
    • Run php artisan view:clear
    • Ensure all assets are published

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

This package is open-sourced software licensed under the MIT license.

About

Advanced File Manager is a powerful Laravel package for organizing files easily, with no jQuery, Bootstrap, or Tailwind dependency. Use it anywhere.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published