Reputation: 10828
It appear there is no validation rule in Laravel that start_date
and end_date
can not be the same.
How do I overcome this?
Upvotes: 0
Views: 469
Reputation: 81
Try this one in controller/model where you defined rules to check, and get the proper validation you want
Validator::extend('before_equal', function($attribute, $value, $parameters) {
return strtotime(Input::get($parameters[0])) >= strtotime($value);
});
$rules = array(
'start'=>'required|date|before_equal:stop',
'stop'=>'required|date',
);
Upvotes: 1