Reputation: 184
when the middleware is added to the elfinder I confronted with this error, but when I amount equal to the null set thhis problem fixed.
'route' => [ 'prefix' => 'elfinder', 'middleware' => null, //Set to null to disable middleware filter ],
config/elfinder.php:
'route' => [ 'prefix' => 'elfinder', 'middleware' => ['web','auth'], //Set to null to disable middleware filter ],
my problem is:
Upvotes: 1
Views: 542
Reputation: 119
this problem solve by under code to app/Http/Middleware/VerifyCsrfToken.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'elfinder/ckeditor',
];
public function handle($request, Closure $next)
{
$regex = '#' . implode('|', $this->except) . '#';
if ($this->isReading($request) || $this->tokensMatch($request) || preg_match($regex, $request->path()))
{
return $this->addCookieToResponse($request, $next($request));
}
throw new TokenMismatchException;
}
}
Upvotes: 1