emmaogunwobi / filemanager
A file upload and management package for Laravel
v2.1.0
2025-04-26 17:20 UTC
Requires
- php: >=8.0
- illuminate/support: *
- laravel/framework: ^10.0 || ^11.0 || ^12.0
README
Welcome to the File Manager package for the Laravel project. This package provides functionalities to manage files within the application.
Features
- Upload files
- Download files
- Delete files
- List files
Installation
To install the package, run:
composer require emmaogunwobi/filemanager
php artisan vendor:publish --provider="Emmaogunwobi\FileManager\FileManagerServiceProvider" --tag=config
php artisan migrate
Usage
Import the package and use the provided methods to manage files
Add the following to the config/app.php file to activate the Facade service
'aliases' => [ // ... 'FileManager' => Emmaogunwobi\FileManager\Facades\FileManager::class, ],
You can use via the Dependency Injection
use Emmaogunwobi\FileManager\Services\FileManagerService; class SomeController extends Controller { protected $fileManager; public function __construct(FileManagerService $fileManager) { $this->fileManager = $fileManager; } public function someMethod() { $result = $this->fileManager->upload('/path/to/file.jpg'); // Do something with $result } }
or via the Facade
use FileManager; // Assuming you've set up the alias class SomeController extends Controller { public function someMethod() { $result = FileManager::upload('/path/to/file.jpg'); // Do something with $result } }
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License.