From a6e154b5fef01a11820c6b9768e1edf4d40874ed Mon Sep 17 00:00:00 2001 From: aliqasemi Date: Mon, 14 Dec 2020 17:46:02 +0330 Subject: [PATCH] edit conflict --- app/Exceptions/Handler.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index cbd773f..a6ca715 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -4,6 +4,9 @@ namespace App\Exceptions; use Throwable; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use WM\Core\Exceptions\ValidationErrorException; +use WM\Core\Services\Responser; + class Handler extends ExceptionHandler { @@ -46,6 +49,10 @@ class Handler extends ExceptionHandler */ public function render($request, Throwable $exception) { + if ($exception instanceof ValidationErrorException) { + return response()->json(Responser::error('تاریخ مورد نظر در زمان انتخابی رزرو شده است',[trans('common::messages.over_lap_date')]), 500); + } + return parent::render($request, $exception); } }