0

So I need a way to redirect and clear a specific cookie if this error occurs but as it doesn't have an actual URL i'm finding it difficult.

GingerFish
  • 457
  • 3
  • 11
  • 26

1 Answers1

1

In app/Exceptions/Handler.php file, in report method you can compare the instance of error with your required error type and return a view accordingly.

if($e instanceof \Illuminate\Session\TokenMismatchException){
    return view('errors.404');
}
Milan Maharjan
  • 4,156
  • 1
  • 21
  • 28