From 706a2ce4ba44d34dea32fcb4193a892124cea4f7 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 10 Sep 2016 15:00:43 +0100 Subject: [PATCH] Close #5, better handling of TokenMismatchException --- app/Exceptions/Handler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 6f212c14..b7f83f0b 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,8 +3,9 @@ namespace App\Exceptions; use Exception; +use Illuminate\Support\Facades\Route; use Illuminate\Auth\AuthenticationException; -use Symfony\Component\Debug\Exception\FlattenException; +use Illuminate\Session\TokenMismatchException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler @@ -45,6 +46,10 @@ class Handler extends ExceptionHandler */ public function render($request, Exception $exception) { + if ($exception instanceof TokenMismatchException) { + Route::getRoutes()->match($request); + } + return parent::render($request, $exception); }