Posted: 29-01-2018

Laravel Before and After Date Validation

Laravel Before and After Date Validation

Laravel provides some very usefull methods to validate date before or after to a given date.

  

after:date

The field under validation must be a value after a given date. The dates will be passed into the strtotime PHP function

 

after_or_equal:date

The field under validation must be a value after or equal to the given date. For more information, see the after rule.

 

before:date

The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function.

 

before_or_equal:date

The field under validation must be a value preceding or equal to the given date. The dates will be passed into the PHP strtotime function.