I want to integrate ckfinder with my laravel but I am stuck with authentication.
I found many ways but there were for older laravel versions and none are working for 5.6.
I found this:
require '../../vendor/autoload.php';
$app = require_once '../../bootstrap/app.php';
$app->make('Illuminate\Contracts\Http\Kernel')
->handle(Illuminate\Http\Request::capture());
But I am getting Invalid request from Ckfinder when I put it in config.php
I would like to access Auth::check() and return it in authentication
require __DIR__ . '/../../vendor/autoload.php';
$app = require_once __DIR__ . '/../../bootstrap/app.php';
$request = Illuminate\Http\Request::capture();
$request->setMethod('GET');
$app->make('Illuminate\Contracts\Http\Kernel')
->handle($request);
$config['authentication'] = function () {
return auth()->check();
};
EDIT
So I had a look at index.php and copied this into config.php:
define('LARAVEL_START', microtime(true));
require '/Applications/MAMP/htdocs/laravel-dealer/vendor/autoload.php';
$app = require_once '/Applications/MAMP/htdocs/laravel-dealer/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
But I am getting runtime exceptions for $acl argument.
Fatal error: Uncaught RuntimeException: Controller "CKSource\CKFinder\Command\Init::execute()" requires that you provide a value for the "$acl" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one. in /Applications/MAMP/htdocs/laravel-dealer/vendor/symfony/http-kernel/Controller/ArgumentResolver.php:78 Stack trace: #0 /Applications/MAMP/htdocs/laravel-dealer/vendor/symfony/http-kernel/HttpKernel.php(141): Symfony\Component\HttpKernel\Controller\ArgumentResolver->getArguments(Object(Symfony\Component\HttpFoundation\Request), Array) #1 /Applications/MAMP/htdocs/laravel-dealer/vendor/symfony/http-kernel/HttpKernel.php(66): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #2 /Applications/MAMP/htdocs/laravel-dealer/public/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/CKFinder.php(610): Symfony\Component\HttpKernel\HttpKernel- in /Applications/MAMP/htdocs/laravel-dealer/vendor/symfony/http-kernel/Controller/ArgumentResolver.php on line 78
Thanks for any help