ckfinder / ckfinder-laravel-package

CKFinder 3 package for Laravel
Other
157 stars 89 forks source link

Couldn't load CKFinder configuration file #1

Open novayadi85 opened 6 years ago

novayadi85 commented 6 years ago

Couldn't load CKFinder configuration file. Please run artisan vendor:publish --tag=ckfinder command first. I've run artisan vendor:publish --tag=ckfinder

I got this issue when i have public_path in public_html: +laravel ++blog (here my laravel) +public_html(here my public) How then the right setting?

khessels commented 6 years ago

when i run: php artisan cache:clear artisan gives me: "LogicException : Your configuration files are not serializable." upon inspection i see that the ckfinder.php file is not serialized.

alexnen commented 5 years ago

php artisan optimize gives me "LogicException : Your configuration files are not serializable." too. Cause of callable $config['authentication']

Yahav commented 5 years ago

@alexnen post your $config['authentication'] from the config file..

alexnen commented 5 years ago

@Yahav sorry, i don't have permissions to this project now. But I remember similar code: ... 'somekey' => function($arg) { return '1'; } ... Seems like CKFinder config had callback functions, and laravel command can't serialize that.

Yahav commented 5 years ago

I see, what you should do is set somekey to null or some default value at the config file, and then at the middleware set it dynamically to use your callback.

Example: config(['ckfinder.authentication' => function() use ($request) { if ($request->user()->hasAnyPermission(['manage files', 'manage images', 'manage podcasts'])) { return true; } return true; }] );

sebastiansulinski commented 3 years ago

You can now associate the middle class name with the ckfinder.authentication - if you preview CKSource\CKFinderBridge\Controller\CKFinderController you will see how it's being used in the constructor.