Download the PHP package runsite/laravel-filemanager without Composer
On this page you can find all versions of the php package runsite/laravel-filemanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-filemanager
laravel-filemanager
A file upload/editor intended for use with Laravel 5.x and CKEditor.
Rationale
There are other packages out there that offer much the same functionality, such as KCFinder, but I found that integration with Laravel was a bit problematic, particularly when it comes to handling sessions and security.
This package is written specifically for Laravel 5, and will integrate seamlessly.
Requirements
- This package only supports Laravel 5.x.
- Requires
"intervention/image": "2.*"
- Requres
"laravelcollective/html": "5.2.*"
- Requires PHP 5.5 or later
Installation
-
Installation is done through composer and packagist. From within your project root directory, execute the following command:
composer require runsite/laravel-filemanager
-
Add the following to the providers array in config/app.php:
-
Add this to the aliases section in config/app.php
-
Publish the package's config file:
php artisan vendor:publish --tag=lfm_config
-
Publish the package's public folder assets:
php artisan vendor:publish --tag=lfm_public
-
If you want to customize the look & feel, then publish the package's views:
php artisan vendor:publish --tag=lfm_views
-
By default, the package will use its own routes. If you don't want to use those routes, change this entry in config/lfm.php to false:
You will, of course, have to set up your own routes.
-
If you don't want to use the default image/file directory or url, update the appropriate lines in config/lfm.php:
-
Ensure that the files & images directories are writable by your web serber
-
In the view where you are using a CKEditor instance, use the file uploader by initializing the CKEditor instance as follows:
Here, "editor" is the id of the textarea you are transforming to a CKEditor instance. Note that if you are using a custom route you will have to change
/runsite/laravel-filemanager?type=Images
to correspond to whatever route you have chosen. Be sure to include the?type=Images
parameter.
Security
It is important to note that if you use your own routes you must protect your routes to Laravel-Filemanager in order to prevent unauthorized uploads to your server. Fortunately, Laravel makes this very easy.
If, for example, you want to ensure that only logged in users have the ability to access the Laravel-Filemanager, simply wrap the routes in a group, perhaps like this:
Route::group(array('before' => 'auth'), function ()
{
Route::get('/runsite/laravel-filemanager', '\Runsite\Laravelfilemanager\controllers\LfmController@show');
Route::post('/runsite/laravel-filemanager/upload', '\Runsite\Laravelfilemanager\controllers\LfmController@upload');
// list all lfm routes here...
});
This approach ensures that only authenticated users have access to the Laravel-Filemanager. If you are using Middleware or some other approach to enforce security, modify as needed.
License
This package is released under the terms of the MIT License.
The MIT License (MIT)
Copyright (c) 2015 Trevor Sawler, Runsite LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.