dimanche 3 avril 2016

validate end date using start date in laravel 5 using request class

This is my request class rules.

'eventDate' => 'required|date|after:yesterday',
'endDate' => 'date|before:event_cals,eventDate',

There I want to verify whether endDate is after the eventDate. It is working properly except when endDate is similar to eventDate. But I want to make sure that there must be able to add an endDate which is similar to eventDate also. For an example if the eventDate is 03/04/2016, there can be able to add an endDate as 03/04/2016 or any upcoming date. But from above rule 03/04/2016 is invalid as an endDate. Is there any keyword for before or equal? Please can any one help me figure out this mess?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire