yoman
1 month ago
172
8
Laravel

Intercept Misstokenmissmatch in Laravel 8

Posted 1 month ago by yoman

Hi,

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()
                  ->back()
                  ->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.