Answer the question
In order to leave comments, you need to log in
How in laravel in the validation class to check the fields relative to each other?
As in the request validation class, make a rule to compare two fields: so that the first cannot be greater than the second, and the second cannot be less than the first. Something like that:
public function rules()
{
return [
'price_min' => 'required|integer|min:0',
'price_max' => 'required|integer|min:0',
];
}
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