您可以在 App Exceptions Handler.php中* 处理TokenMismatchException异常 *
<?php namespace AppExceptions;use Exception;use IlluminateFoundationExceptionsHandler as ExceptionHandler;use IlluminateSessionTokenMismatchException;class Handler extends ExceptionHandler { protected $dontReport = [ 'SymfonyComponentHttpKernelExceptionHttpException' ]; public function report(Exception $e) { return parent::report($e); } public function render($request, Exception $e) { if ($e instanceof TokenMismatchException){ // Redirect to a form. Here is an example of how I handle mine return redirect($request->fullUrl())->with('csrf_error',"Oops! Seems you couldn't submit form for a long time. Please try again."); } return parent::render($request, $e); }}


