rabol
392
7
General

Method Illuminate\Validation\Validator::validateRequired|date|before does not exist.

Posted 5 months ago by rabol

Hi

In a form request I try to validate that the start date is before today and the end date is before the start date in my FormRequest derived class i have this: public function rules() { return [

        'start_date'    => ['required|date|before:today'],
        'end_date'      => ['date|before:start_date']
     ];

}

public function messages() { return [ 'start_date.required' => 'The :attribute field is required.', 'start_date.before' => 'The :attribute field must be before today', ]; }

when I submit my form I get this error:

Method Illuminate\Validation\Validator::validateRequired|date|before does not exist.

What did I miss ?

Thanks

Please sign in or create an account to participate in this conversation.