Date validation



   $request->validate(
   
    
   'date_field' => 'date'
   

   );
   
Try it!

Specific date validation



   $request->validate(
   
    
   'date_field' => 'date_equals:11/30/2022'
   

   );
   
Try it!

Specific date and time validation



   $request->validate(
   
    
   'date_field' => 'date_equals:11/30/2022 13:00'
   

   );
   
Try it!

Validate date if input is not empty



   $request->validate(
   
    
   'date_field' => 'date|nullable'
   

   );
   
Try it!

Before date validation



   $request->validate(
   
    
   'date_field' => 'before:11/30/2022'
   

   );
   
Try it!

Before or equal date validation



   $request->validate(
   
    
   'date_field' => 'before_or_equal:11/30/2022 13:00'
   

   );
   
Try it!

After date validation



   $request->validate(
   
    
   'date_field' => 'after:11/30/2022 13:00'
   

   );
   
Try it!

After or equal date validation



   $request->validate(
   
    
   'date_field' => 'after_or_equal:11/30/2022'
   

   );
   
Try it!

Between dates validation (date range)



   $request->validate(
   
    
   'date_field' => 'after:11/01/2022|before:11/30/2022'
   

   );
   
Try it!

Between or equal dates validation (date range)



   $request->validate(
   
    
   'date_field' => 'after_or_equal:11/01/2022|before_or_equal:11/30/2022'
   

   );
   
Try it!

Date format validation



   $request->validate(
   
    
   'date_field' => 'date_format:m/d/Y'
   

   );
   
Try it!

Time validation



   $request->validate(
   
    
   'date_field' => 'date_format:H:i:s'
   

   );
   
Try it!

Time AM/PM format validation



   $request->validate(
   
    
   'date_field' => 'date_format:h:i A'
   

   );
   
Try it!

Validate date has specific minutes

Using vdhicts/laravel-validation-rules package


   $request->validate(
   
    
   'date_field' => [new DateHasSpecificMinutes([0, 15, 30, 45], 'm/d/Y H:i')]
   

   );
   
Try it!

Validate date against ISO8601 standard

Using penance316/laravel-iso8601-validator package


   $request->validate(
   
    
   'date_field' => 'date|iso_date'
   

   );
   
Try it!

Timezone validation



   $request->validate(
   
    
   'timezone_field' => 'timezone'
   

   );
   
Try it!

Validate Unix timestamp



   $request->validate(
   
    
   'timestamp_field' => 'integer|min:1'
   

   );
   
Try it!