added ajax response

This commit is contained in:
Denis Duliçi 2023-04-24 13:33:55 +03:00
parent 43efb5210b
commit 64a0def402

View File

@ -208,6 +208,12 @@ class Handler extends ExceptionHandler
if (! empty($matches[0])) {
event(new InvalidEmailDetected($matches[0], $exception->getMessage()));
if ($request->ajax()) {
return response()->json([
'error' => trans('notifications.menu.invalid_email.description', ['email' => $matches[0]]),
], $exception->getCode());
}
}
}