Laravel 4验证被破坏 [英] Laravel 4 Validation is Broken
本文介绍了Laravel 4验证被破坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只需要一个简单的日期格式mm/dd/yyyy验证...
A simple date format mm/dd/yyyy validation is all I need...
$rules = array(
'renewal_date' => array('required', 'date_format:?')
);
我将日期格式设置为什么? Laravel文档可能会更好.
What do I set the date format to? The Laravel documentation could be so much better.
推荐答案
解决方法:
'renewal_date' => array('required', 'date_format:m/d/Y', 'regex:/[0-9]{2}\/[0-9]{2}\/[0-9]{4}/')
这篇关于Laravel 4验证被破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文