My project is Laravel 5.4, I use Laravel-elfinder by Barryvdh, it works very nice but when I append my authenticate middleware, is not work as my expected.
Expected: Only authenticated user can use Elfinder
Right now: Login success but elfinder cannot recognize session, Auth::user() is null
I'm using custom auth class and here is my AuthVerification.php middleware.
<?php
namespace App\Http\Middleware;
use App\Libraries\Routes\Routes;
use Closure;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class AuthVerification
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if(!Auth::check()){
return redirect('/guest/login');
}
return $next($request);
}
}
I put this middleware info config/elfinder.php but when I access and login http://example.com/elfinder/tinymce4 my Auth::user() always null when I dd(Auth::user()) in ElfinderController.php and tinymce4.blade.php
'route' => [
'prefix' => 'elfinder',
'middleware' => 'AuthVerification', //Set to null to disable middleware filter
],
Does need any specific way to make my custom auth class work with elfinder?
My project is Laravel 5.4, I use Laravel-elfinder by Barryvdh, it works very nice but when I append my authenticate middleware, is not work as my expected.
Expected: Only authenticated user can use Elfinder Right now: Login success but elfinder cannot recognize session,
Auth::user()
isnull
I'm using custom auth class and here is my
AuthVerification.php
middleware.I put this middleware info
config/elfinder.php
but when I access and loginhttp://example.com/elfinder/tinymce4
myAuth::user()
always null when Idd(Auth::user())
inElfinderController.php
andtinymce4.blade.php
Does need any specific way to make my custom auth class work with elfinder?