Laravel Validation date_equals date Example

Admin   Laravel   294  2021-03-14 22:40:04

Hi Guys,

Today, I will learn you to create validation date_equals date in laravel.we will show example of laravel validation date_equals date.The field under validation must be a value date_equals a given date. The dates will be passed into the strtotime PHP function.you can simply apply to validation to date_equals date validation in laravel.

Here, I will give you full example for simply date_equals date validation in laravel bellow.

solution

 

$request->validate([

'start_date' => 'required|date|date_equals:brith_date',

'brith_date' => 'required|date',

]);

Route : routes/web.php

 

Route::get('form/create','[email protected]');

Route::post('form/store','[email protected]')->name('form.store');

Controller : app/Http/Controllers/BlogController.php