Inspired by serverless and quickadmin. you can use it at your own risk
TODO: required_once field, soft delete, fields (datetime, password, repeat)
If installation failed - remove DB, routes/web.php and set app/Providers/AppServiceProvider.php to default value.
- Configure DB and APP_URL file .env
- composer require sv-digiants/fastadminpanel
- Publish the packages config and assets:
php artisan vendor:publish --tag=fap_public
andphp artisan vendor:publish --tag=fap_view
- php artisan fastadminpanel:install
- And add class aliases:
'Image' => Intervention\Image\Facades\Image::class,
- Publish the packages config and assets:
php artisan vendor:publish --tag=lfm_config
andphp artisan vendor:publish --tag=lfm_public
- Run commands to clear cache:
php artisan route:clear
andphp artisan config:clear
- In "config/lfm.php":
add line: 'middlewares' => ['admin'],
change line: ('disk' => 'public',) to ('disk' => 'lfm',)
- Add disk "config/filesystems.php":
'lfm' => [
'driver' => 'local',
'root' => public_path(),
'url' => env('APP_URL'),
'visibility' => 'public',
],
- /vendor/unisharp/laravel-filemanager/src/Lfm.php
// Change first function:
public function getNameFromPath($path)
{
return Lfm::mb_pathinfo($path, PATHINFO_BASENAME);
}
// Add function
public static function mb_pathinfo($path, $options = null)
{
$ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '');
$pathinfo = array();
if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
if (array_key_exists(1, $pathinfo)) {
$ret['dirname'] = $pathinfo[1];
}
if (array_key_exists(2, $pathinfo)) {
$ret['basename'] = $pathinfo[2];
}
if (array_key_exists(5, $pathinfo)) {
$ret['extension'] = $pathinfo[5];
}
if (array_key_exists(3, $pathinfo)) {
$ret['filename'] = $pathinfo[3];
}
}
switch ($options) {
case PATHINFO_DIRNAME:
case 'dirname':
return $ret['dirname'];
case PATHINFO_BASENAME:
case 'basename':
return $ret['basename'];
case PATHINFO_EXTENSION:
case 'extension':
return $ret['extension'];
case PATHINFO_FILENAME:
case 'filename':
return $ret['filename'];
default:
return $ret;
}
}
- /vendor/unisharp/laravel-filemanager/src/Controllers/UploadController.php:
// change line 46:
$response = count($error_bag) > 0 ? $error_bag : parent::$success_response;
// to:
$response = count($error_bag) > 0 ? $error_bag : array(parent::$success_response);