From 4b41b67f415c54c54bd547d6a9d48779075f87bb Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sat, 30 Jun 2018 08:39:43 +0800 Subject: [PATCH] Change flash message type danger to error Since we are using noty js for flash messages, noty does not have danger type, it has error type of notification. --- app/Exceptions/Handler.php | 4 ++-- app/Http/Requests/Request.php | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3cd05bb..f3fc95d 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -54,7 +54,7 @@ class Handler extends ExceptionHandler return response()->json(['error' => 'Forbidden Action.'], 403); } - flash(__('auth.unauthorized_access', ['url' => $request->path()]), 'danger'); + flash(__('auth.unauthorized_access', ['url' => $request->path()]), 'error'); return redirect()->home(); } @@ -64,7 +64,7 @@ class Handler extends ExceptionHandler return response()->json(['error' => 'Data not found.'], 404); } - flash('Data not found.', 'danger'); + flash('Data not found.', 'error'); return redirect()->home(); } diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php index dfddd78..912c905 100644 --- a/app/Http/Requests/Request.php +++ b/app/Http/Requests/Request.php @@ -8,11 +8,16 @@ use Illuminate\Contracts\Validation\Validator; abstract class Request extends FormRequest { /** - * {@inheritdoc} + * Handle a failed validation attempt. + * + * @param \Illuminate\Contracts\Validation\Validator $validator + * @return void + * + * @throws \Illuminate\Validation\ValidationException */ protected function failedValidation(Validator $validator) { - flash(__('validation.flash_message'), 'danger'); + flash(__('validation.flash_message'), 'error'); parent::failedValidation($validator); } }