在Laravel 5中的表单请求验证后传递旧的输入 [英] Pass old input after Form Request validation in laravel 5

查看:89
本文介绍了在Laravel 5中的表单请求验证后传递旧的输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果验证失败,我不清楚如何通过旧输入再次填写表格.

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

我的意思是,我知道在使用Validator类时如何传递数据,以及使用withInput()方法失败后如何重定向,但是我正在尝试学习如何使用laravel 5中提供的Form Requests.谢谢

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

推荐答案

$username = Request::old('username');

或在视野范围内:

{{ old('username') }}

了解更多: http://laravel.com/docs/5.0/requests#old -输入

这篇关于在Laravel 5中的表单请求验证后传递旧的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆