Nasr1
412
2
Laravel

How to make my routes implement session in laravel 5.1

Posted 1 year ago by Nasr1

Hello am making a simple Session::flash so i need to make my controller to use middleware , i know i can use middleware web , unfortuentaly am using laravel 5.1 , so web middleware is not exist , so what middleware or what should i do to make my controller or my routes implement session ? this is my kernel file :-

class Kernel extends HttpKernel
    {
            protected $middleware = [
                
    \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    \App\Http\Middleware\EncryptCookies::class,
    \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
    \Illuminate\Session\Middleware\StartSession::class,
    \Illuminate\View\Middleware\ShareErrorsFromSession::class,
    //\App\Http\Middleware\VerifyCsrfToken::class,
  ];


protected $routeMiddleware = [
    'auth' => \App\Http\Middleware\Authenticate::class,
    'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
    'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
    'jwt.auth' => 'Tymon\JWTAuth\Middleware\GetUserFromToken',
'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken',
];

thanks in advance Guys :)

Please sign in or create an account to participate in this conversation.