Issue
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>{{ $error }}</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
$errors
variable 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?
Solution
To anyone that has this problem, how I solved it was changing the .env
file from SESSION_DRIVER=array
to SESSION_DRIVER=file
Answered By - Haring10
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.