Download the PHP package amedev/file-manager without Composer
On this page you can find all versions of the php package amedev/file-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package file-manager
๐ FileManager
FileManager is a Laravel package for polymorphic file management.
It provides a centralized API for uploading files and attaching them to any model, with support for multiple storage disks and dynamic model resolution.
๐ฆ Installation
Install the package via Composer:
composer require amedev/file-manager
php artisan vendor:publish --tag=config
php artisan vendor:publish --tag=file-manager-migrations
php artisan vendor:publish --tag=file-manager-models
php artisan migrate
โ๏ธ Configuration
File: config/filemanager.php
return [
/*
|--------------------------------------------------------------------------
| Default Storage Disk
|--------------------------------------------------------------------------
| Supported options: 'local', 'public', 'sftp'
*/
'disk' => env('FILE_MANAGER_DISK', 'sftp'),
/*
|--------------------------------------------------------------------------
| Default Upload Path
|--------------------------------------------------------------------------
*/
'default_path' => 'uploads',
/*
|--------------------------------------------------------------------------
| Model Map
|--------------------------------------------------------------------------
| Maps model aliases to actual class names.
| Used for polymorphic file attachment.
*/
'model_map' => [
'user' => \App\Models\User::class,
// Add more models as needed
],
];
๐งช API Usage
Upload Files
POST /filemanager/upload
Content-Type: multipart/form-data
fields:
- model_type: user
- model_id: 5
- files[]: (multiple files)
[
{
"id": 1,
"path": "uploads/user/files/abc123.png",
"mime_type": "image/png",
"size": 31200,
"field": "files"
},
...
]
๐งฌ Polymorphic Relation
The File model uses a morphTo relation:
public function fileable()
{
return $this->morphTo();
}
๐ Artisan Commands
Fix Model Namespace
php artisan file-manager:fix-model-namespaceAll versions of file-manager with dependencies
PHP Build Version
Package Version
The package amedev/file-manager contains the following files
Loading the files please wait ...