From 233b2d4e391615660be8fed327f8d1f4e389f10e Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 22 Jan 2017 16:45:19 +0800 Subject: [PATCH] return error message directly when requested with POST --- app/Exceptions/Handler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index a096c58b..8790a1ab 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -108,6 +108,10 @@ class Handler extends ExceptionHandler */ protected function renderExceptionInBrief(Exception $e) { - return response()->view('errors.exception', ['message' => $e->getMessage()]); + if ($_SERVER['REQUEST_METHOD'] == "GET") { + return response()->view('errors.exception', ['message' => $e->getMessage()]); + } else { + return $e->getMessage(); + } } }