/** * Redirect to previous page with error rather than throwing exception. */ public function handle($request, \Closure $next) { if ($request->input('_token')) { if (\Session::getToken() != $request->input('_token')) { return redirect()->guest('/')->with('global', 'Your session has expired. Please try logging in again.'); } } return parent::handle($request, $next); }