Requirements
- php >= 5.4
- exif extension
- fileinfo extension
- GD Library >=2.0 or Imagick PHP extension >=6.5.7
- Laravel 5
- requires intervention/image (to make thumbs, crop and resize images).
TL;DR
-
Run these lines
composer require unisharp/laravel-filemanager php artisan vendor:publish --tag=lfm_config php artisan vendor:publish --tag=lfm_public php artisan storage:link
-
Edit
APP_URL
in.env
.
Full Installation Guide
-
Install package
composer require unisharp/laravel-filemanager
-
(optional) Install required dependency with
v3.*
ofintervention/image
:This package use
intervention/image
to perform image cropping/resizing and generating thumbnails. Sincev3.*
ofintervention/image
does not support Laravel by default, the service provider need to be installed with the following scripts. Details can be found here: https://github.com/Intervention/image-laravelcomposer require intervention/image-laravel php artisan vendor:publish --provider="Intervention\Image\Laravel\ServiceProvider"
* Do not run these scripts if you use
v2.*
ofintervention/image
. -
Publish the package’s config and assets :
php artisan vendor:publish --tag=lfm_config php artisan vendor:publish --tag=lfm_public
-
(optional) Run commands to clear cache :
php artisan route:clear php artisan config:clear
-
Ensure that the files & images directories (in
config/lfm.php
) are writable by your web server (run commands likechown
orchmod
). -
Create symbolic link :
php artisan storage:link
-
Edit
APP_URL
in.env
. -
Edit
routes/web.php
:Create route group to wrap package routes.
Route::group(['prefix' => 'laravel-filemanager', 'middleware' => ['web', 'auth']], function () { \UniSharp\LaravelFilemanager\Lfm::routes(); });
Make sure
auth
middleware is present to :- prevent unauthorized uploads
- work properly with multi-user mode
-
make sure database exists
-
login and visit
/laravel-filemanager/demo
Installing alpha version
- Run
composer require unisharp/laravel-filemanager:dev-master
to get the latest developer version.
What’s next
-
Check the integration document to see how to apply this package.
-
Check the config document to discover the flexibility of this package.