laravel-filemanager icon indicating copy to clipboard operation
laravel-filemanager copied to clipboard

error when open /laravel-filemanager?type=Images&CKEditor=text&CKEditorFuncNum=1 route

Open mmiladkdr opened this issue 5 years ago • 7 comments

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)
Screen Shot 2019-06-16 at 10 30 41 PM Screen Shot 2019-06-16 at 10 35 25 PM Screen Shot 2019-06-16 at 10 35 31 PM

And provide the followings :

  • Operating system 👍
  • Laravel version :5.8
  • Package version :2
  • Steps to reproduce your issue :
  • Screenshots of browser console :

mmiladkdr avatar Jun 16 '19 18:06 mmiladkdr

@miladkardgar Hi, I suppose u don't correctly set mime file types in config/lfm.php or CKEditor config.

subtronic avatar Jun 17 '19 09:06 subtronic

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

Basdl76 avatar Sep 02 '19 11:09 Basdl76

miladkardgar: Same problem here when trying to upgrade to version 2.0.0 of UniSharp/laravel-filemanager. Did you solve this? 

Tommy001 avatar Jan 25 '20 15:01 Tommy001

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 ..

okandas avatar Feb 10 '20 08:02 okandas

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 ..

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

afrizal423 avatar Mar 05 '20 06:03 afrizal423

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'.

tumispro avatar Mar 20 '20 11:03 tumispro

Just run php artisan config:clear

danish-therightsw avatar Jun 09 '21 14:06 danish-therightsw