suncoastkid suncoastkid - 2 years ago 100
PHP Question

Laravel 4 Validation is Broken

A simple date format mm/dd/yyyy validation is all I need...

$rules = array(
'renewal_date' => array('required', 'date_format:?')

What do I set the date format to? The Laravel documentation could be so much better.

Answer Source


'renewal_date' => array('required', 'date_format:m/d/Y', 'regex:/[0-9]{2}\/[0-9]{2}\/[0-9]{4}/')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download