laravel page expired redirect to login

Solutions on MaxInterview for laravel page expired redirect to login by the best coders in the world

showing results for - "laravel page expired redirect to login"
Helena
04 May 2017
1# add function in  app/Exceptions/Handler.php
2
3
4protected function prepareException(Exception $e)
5{
6        if ($e instanceof ModelNotFoundException) {
7            $e = new NotFoundHttpException($e->getMessage(), $e);
8        } elseif ($e instanceof AuthorizationException) {
9            $e = new AccessDeniedHttpException($e->getMessage(), $e);
10        } elseif ($e instanceof TokenMismatchException) {
11              return redirect()->route('login');
12        }
13        return $e;
14}