Browse Source

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.
pull/12/head
Nafies Luthfi 8 years ago
parent
commit
4b41b67f41
  1. 4
      app/Exceptions/Handler.php
  2. 9
      app/Http/Requests/Request.php

4
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();
}

9
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);
}
}
Loading…
Cancel
Save