Mar 21, 2016
0
Level 1
Session, route and middleware
Hello, I try to display a current session in roads . It seems that the sessions are not yet established at this point . So I thought beforeMiddleware use , but it is not working .
I did :
use Closure;
class BeforeMiddleware implements Middleware {
public function handle($request, Closure $next)
{
dd('test');
return $next($request);
}
}
Kernel :
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\BeforeMiddleware::class,
Route :
Route::group(['middleware' => ['web']], function () {
dd(Session::get('locale'));
Thank you for your help.
Please or to participate in this conversation.