Every Blade View have $errors variable bounded to it unless you set different one by yourself. If you use controller based error handling, you will probably have something like this inside it:
1 2 3 4 5 6 |
if ($validator->fails()) { return Redirect::to('/profile') ->withErrors($validator) ->withInput(); } |
We passed validation errors to the profile view using withErrors() method and inside that view you can display them:
1 2 3 4 5 |
@if($errors->has()) @foreach ($errors->all() as $error) <div>{{ $error }}</div> @endforeach @endif |
Latest posts by Mirza Pasic (see all)
- Quick tip: How to delete a tag from a Git repository? - August 20, 2016
- Laravel Accessors and Mutators - December 17, 2015
- How to allow remote connections to PostgreSQL database server - December 15, 2015