How to validate time in laravel

Vikash picture Vikash · Sep 13, 2016 · Viewed 38.6k times · Source

I want to validate time in Laravel. Ex:- I want that when user input the time between 8 PM to 10 PM then it will show the validation error. How can I achieve that in Laravel

Answer

Chathuranga Tennakoon picture Chathuranga Tennakoon · Dec 21, 2017

Use date_format rule validation

date_format:H:i

From docs

date_format:format

The field under validation must match the format defined according to the date_parse_from_format PHP function.