in controller i'm using:
if ($validator->fails())
{
return Redirect::to('/admin/profile')
->withErrors($validator)
->withInput();
}
how to get result of withErrors in view ?
{{ $errors->all() }}
If you want to show all errors in one place you can use
@foreach ($errors->all() as $error)
<div>{{ $error }}</div>
@endforeach
If you want to show each field's errors e.g. bellow the field you can use (e.g. for email)
{{ $errors->first('email') }}
we use first() in order to show only one error each time for each field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With