laravel-filemanager
laravel-filemanager copied to clipboard
error when open /laravel-filemanager?type=Images&CKEditor=text&CKEditorFuncNum=1 route
hi guys ; why when open file manager windows show this error on ckeditor:
"implode(): Invalid arguments passed (View: /Users/milad/Projects/ashraf_new/resources/views/vendor/laravel-filemanager/index.blade.php)"
ErrorException (E_ERROR)
implode(): Invalid arguments passed (View: /Users/milad/Projects/ashraf_new/resources/views/vendor/laravel-filemanager/index.blade.php)
Previous exceptions
implode(): Invalid arguments passed (0)
And provide the followings :
- Operating system 👍
- Laravel version :5.8
- Package version :2
- Steps to reproduce your issue :
- Screenshots of browser console :
@miladkardgar Hi, I suppose u don't correctly set mime file types in config/lfm.php or CKEditor config.
Same problem here, want to install van-ons/laraberg with UniSharp/laravel-filemanager. What do i do wrong? I have installed both and when i open www.domain.com/laravel-filemanager?type=Files i am getting the same error as miladkardgar mentioned. I followed the installation guide. The issue is for composer require unisharp/laravel-filemanager:dev-master now i have installed composer require unisharp/laravel-filemanager:~1.8 and works. Installed by guide https://unisharp.github.io/laravel-filemanager/installation
miladkardgar: Same problem here when trying to upgrade to version 2.0.0 of UniSharp/laravel-filemanager. Did you solve this?
hello .. please make sure your config file lfm.php
has this set
'folder_categories' => [
'file' => [
'folder_name' => 'files',
'startup_view' => 'grid',
'max_size' => 50000, // size in KB
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
],
],
'image' => [
'folder_name' => 'photos',
'startup_view' => 'list',
'max_size' => 50000, // size in KB
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
'application/pdf',
'text/plain',
],
],
],
this is because when $helper->availableMimeTypes() is called it looks for this in the config file and doesn't find an array hence the error ..
hello .. please make sure your config file
lfm.phphas this set
'folder_categories' => [ 'file' => [ 'folder_name' => 'files', 'startup_view' => 'grid', 'max_size' => 50000, // size in KB 'valid_mime' => [ 'image/jpeg', 'image/pjpeg', 'image/png', 'image/gif', 'image/svg+xml', ], ], 'image' => [ 'folder_name' => 'photos', 'startup_view' => 'list', 'max_size' => 50000, // size in KB 'valid_mime' => [ 'image/jpeg', 'image/pjpeg', 'image/png', 'image/gif', 'image/svg+xml', 'application/pdf', 'text/plain', ], ], ],this is because when
$helper->availableMimeTypes()is called it looks for this in the config file and doesn't find an array hence the error ..
this is the same as my problem in laravel 6. I followed your advice, it can already be uploaded, but can not be displayed. which in the end I edited it like this.
'folder_categories' => [
'file' => [
'folder_name' => 'public/files',
'startup_view' => 'grid',
'max_size' => 50000, // size in KB
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
],
],
'image' => [
'folder_name' => 'public/photos',
'startup_view' => 'list',
'max_size' => 50000, // size in KB
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
'application/pdf',
'text/plain',
],
],
],
because the url will access the storage folder, the storage is read in the public folder. so I put it in the public folder.
CMIIW
Delete your config file (config/lfm.php) and publish it again (php artisan vendor:publish).
Make sure to restore your settings afterwards! A useful method in PHPStorm is to copy all the text of your config, replace the config file and then right click -> 'Compare with Clipboard'.
Just run php artisan config:clear