Pass old input after Form Request validation in laravel 5

GabAntonelli picture GabAntonelli · Mar 23, 2015 · Viewed 27.9k times · Source

if the validation fails it's not clear to me how i could pass the old input to fill again the form.

I mean, I know how to pass the data when using the Validator class and redirecting after fail with the method withInput(), but I'm trying to learn how to use Form Requests provided in laravel 5. Thanks

Answer

Limon Monte picture Limon Monte · Mar 23, 2015
$username = Request::old('username');

or in view:

{{ old('username') }}

Read more: http://laravel.com/docs/5.0/requests#old-input