Answer the question
In order to leave comments, you need to log in
Laravel 8 Ckeditor5 validating authentication?
Hello, I have such a space, I installed Ckeditor 5 on laravel 8 and so in the file (ckfinder) config.php there is $config['authentication']. authentication'] == true and in other cases false. I tried via Auth it doesn't work
Answer the question
In order to leave comments, you need to log in
Try this option:
$config['authentication'] = function () {
require $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
$app = require_once $_SERVER['DOCUMENT_ROOT']. '/bootstrap/app.php';
$request = Illuminate\Http\Request::capture();
$request->setMethod('GET');
$app->make('Illuminate\Contracts\Http\Kernel')->handle($request);
if (Auth::check() && Auth::user()->is_admin ) {
return true;
} else {
header('HTTP/1.0 403 Forbidden');
exit();
}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question