Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel before today rule... how to do

Tags:

For this rule I am getting an error syntax error, unexpected '.', expecting ')'

public static $rules = array(
    'first_name' => 'required|alpha-dash',
    'last_name' => ' required|alpha-dash',
    'media_release' => 'required|boolean',
    'birthday' => 'before:' . date('Y-m-d')

);

I can't figure out why this won't work. I'm running Laravel 4.2.12

like image 357
Phil Avatar asked Dec 23 '14 16:12

Phil


1 Answers

try this:

'birthday' => 'date_format:Y-m-d|before:today',

bye

like image 197
Fernando lugo Avatar answered Oct 26 '22 14:10

Fernando lugo