2 days ago

Intercept Misstokenmissmatch in Laravel 8

Posted 2 days ago by yoman


does anyone know how to intercept the page expired (419) or Misstokenmissmatch error in laravel 8 ?

looks like this method, not working anymore

  public function render($request, Exception $exception)
        //if token missmatch
        if ($exception instanceof \Illuminate\Session\TokenMismatchException) {
              return redirect()
                  ->withInput($request->input())->with('warning', 'sorry, please submit again');

        return parent::render($request, $exception);

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