1

Hi I want to make after date-before date control that is using request validation in laravel. So, starting date should not be more than end date. how can do this. I would appreciate if you could help me.

public function rules()
{
    return [
         'start_date' =>'required|date_format:d.m.Y',
         'end_date'   =>'required|date_format:d.m.Y',
    ];
}
onerciller
  • 760
  • 1
  • 8
  • 13

1 Answers1

3

I solved it in this way.

public function rules()

{
    return [

         'start_date =>'required|date_format:d.m.Y',
         'end_date' =>'required|date_format:d.m.Y|after:start_date'       
 ];

}
onerciller
  • 760
  • 1
  • 8
  • 13