Answers for "laravel page expired redirect to login"

PHP
0

laravel page expired redirect to login

# add function in  app/Exceptions/Handler.php


protected function prepareException(Exception $e)
{
        if ($e instanceof ModelNotFoundException) {
            $e = new NotFoundHttpException($e->getMessage(), $e);
        } elseif ($e instanceof AuthorizationException) {
            $e = new AccessDeniedHttpException($e->getMessage(), $e);
        } elseif ($e instanceof TokenMismatchException) {
              return redirect()->route('login');
        }
        return $e;
}
Posted by: Guest on April-20-2021

Code answers related to "laravel page expired redirect to login"

Browse Popular Code Answers by Language