Good afternoon, comrades. Tell me who knows how to add more than 1 unique field to the validator class in laravel. If we assume I have unique fields used in conjunction with (for example, series and card number).
return Validator::make($data, [ 'serial' => 'required|min:3|unique:cards,serial', 'number' => 'required|min:8|max:8|regex:/[0-9]{8,8}/', 'date_close' => 'required', ]);
I tried it but it does not help, it still knocks out an error at the first entry of the serial, and does not even get to check the number. And in theory, should swear only when both values in the line are the same.
return Validator::make($data, [ 'serial' => 'required|min:3|unique:cards,serial', 'number' => 'required|min:8|max:8|unique:cards,number|regex:/[0-9]{8,8}/', 'date_close' => 'required', ]);