Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lamngockhuong/0a3ef3615da69350c91816e2cdbc6ac3 to your computer and use it in GitHub Desktop.
Save lamngockhuong/0a3ef3615da69350c91816e2cdbc6ac3 to your computer and use it in GitHub Desktop.
[CKFinder Authentication Configuration for laravel 5] #laravel #ckfinder #ckeditor

Open and edit file 'ckfinder/config.php':

require dirname(__DIR__, 3) .'/vendor/autoload.php';
$app = require dirname(__DIR__, 3) . '/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$kernel->handle($request = Illuminate\Http\Request::capture());

$config['authentication'] = function () {
    if (auth()->guest()) {
        return false;
    } else {
        return auth()->user()->is_admin; // is_admin: attribute in model
    }
};


@cyimking
Copy link

cyimking commented Feb 6, 2019

@alan

@alantulais:

When try it. I get this error:
Call to a member function make() on bool

Were you able to find a solution? I am getting the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment