This package provides a lightweight file explorer that can be easily customised and integrated into your laravel applications.
- Laravel ^5+
- jQuery ^3.4.1+
- Bootstrap ^4.4.1+
Install with Composer:
composer require crowles/laravel-filebrowser
First you'll need to add the Service Provider to your config/app.php
:
Crowles\FileBrowser\FileBrowserServiceProvider::class,
Then publish the vendor assets:
php artisan vendor:publish --provider="Crowles\FileBrowser\FileBrowserServiceProvider" --tag views
php artisan vendor:publish --provider="Crowles\FileBrowser\FileBrowserServiceProvider" --tag assets
php artisan vendor:publish --provider="Crowles\FileBrowser\FileBrowserServiceProvider" --tag config
You'll now need to add the path to the root directory you want the file browser to access, do this by changing the following environment variables loaded in config/filebrowser.php
:
/*
|--------------------------------------------------------------------------
| Path
|--------------------------------------------------------------------------
|
| The path to scan for files and folders.
|
| You must use an absolute path.
|
*/
'path' => env('FILEBROWSER_PATH', ''),
/*
|--------------------------------------------------------------------------
| Root
|--------------------------------------------------------------------------
|
| The root diectory where you want to initialise the file browser
|
*/
'root' => env('FILEBROWSER_ROOT', ''),
The following routes are configured by default with prefix filebrowser/
:
$router->get('/', '\Crowles\FileBrowser\FileBrowserController@index');
$router->get('/scan', '\Crowles\FileBrowser\FileBrowserController@scan');
Laravel File Browser is open-sourced software licensed under the MIT license.