You can create custom exception rendering in the class App\Exceptions\Handler (in the file /app/Exceptions/Handler.php ).
For example, to render another view, when for a TokenMismatchException error TokenMismatchException you can change the render method to something like this:
public function render($request, Exception $e) { if ($e instanceof \Illuminate\Session\TokenMismatchException) { return response()->view('errors.custom', [], 500); } return parent::render($request, $e); }
Hieu le
source share