Answer the question
In order to leave comments, you need to log in
What is the correct way to use custom validation rule in formRequest for more than one parameter?
Good afternoon
I'm asking this question not for the first time - because usually it's not always possible to convey what exactly "doesn't work", so sorry for the extra detail I'm
using Laravel v5.8
There is a form that comes with 3 parameters A,B,C
For standard validation, usually I'm used to using FormRequest, and in this case it will look something like this:
public function rules()
{
return [
'A'=>['required','min:2'],
'B'=>['required','min:5'],
'C'=>['required','email'],
];
} // func
public function rules()
{
return [
'A'=>['required','min:2', new CustomValidationRule],
'B'=>['required','min:5'],
'C'=>['required','email'],
];
} // func
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question