I am trying to display errors on my login page using the Session::flash() method in Laravel 5.1.
In my view I am using:
@if($errors->has())
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
<div></div>
@endforeach
</div>
@endif
And in my controller:
return Redirect::route('login')->withErrors($validator)->withInput();
-
I am not getting anything from the Input::old() method when getting redirected with errors to this page.
-
The
$errorsvariable is empty on the reload.
If I dd($validator); right before the return Redirect::route..., the $validator has data in it:
But when the page loads, nothing happens.
I can try Session::put but still, nothing happens when getting the view.
What could be wrong? Is there maybe something in composer or php artisan that may be able to reset this issue?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire