laravel validate date
snippet in php

Date time format for laravel validation

user2133

 $request->validate([
        'start_date' => 'date_format:d/m/Y',
        'end_date' => 'date_format:d/m/Y'
    ]);

if any error in blade laravel

user5450

 @if ($errors->any())
     @foreach ($errors->all() as $error)
         <div>{{$error}}</div>
     @endforeach
 @endif

in laravel date duration validation rule

user6903

[
  'from' =>  ['required', 'date_format:Y-m-d', 'before_or_equal:to'],
  'to'  => ['required', 'date_format:Y-m-d']
]
//@sujay

laravel validate date

user8979

 'day'            =>  'required|date',

in laravel date duration validation rule

user3369

public function store(Request $request)

{

    $todayDate = date('m/d/Y');



    $request->validate([

        'name' => 'required',

        'email' => 'required|email',

        'start_date' => 'date_format:m/d/Y|after_or_equal:'.$todayDate

    ]);
}
//@sujay