This seems like such a simple task but after an hour I still can't figure it out.
It's just a login page, and I can login just fine, but in case of error I want the email address to persist. I'm calling "withInput();" on the redirect but in the Twig template no matter what variable I use, I can't seem to get it to work. The name of the field is "email"
Controller:
catch (Cartalyst\Sentry\Users\WrongPasswordException $e)
{
$error = 'Wrong password, try again.';
return Redirect::back()->withInput()->withErrors($error);
}
View:
{{ input.email }}
{{ input.old.email }}
{{ Session_get('email') }}
{{ input.old }}
{{ email }}
{{ input }}
{{ input_old.email }}
{{ old.email }}
In Blade it looks like you call "input::old('email')" but that throws an exception in Twig.
Please note that in Laravel 5.2, you must apply the 'web' middleware to the route, or input_old won't work at all. Just got bitten by this.
I am having the same problem but in Laravel 5.2 Input class is not included anymore you have to use {{old('name')}} but it's not working for me anyway, when the page redirects me back old information is not in my inputs. Any help would be great.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community