I just ran into an issue where I was using a 'gte' (greater than or equal to) validator with the WithValidation concern, and the import was always throwing a validation error no matter what the values I was using in the relevant fields. I finally figured out that I needed to include an asterisk before the field name, since it is validating in batches. I.e.:
public function rules(): array
{
return [
// This doesn't work:
'maximum_percent' => 'gte:minimum_percent',
// This does:
'maximum_percent' => 'gte:*.minimum_percent',
];
}
I'm submitting this as a question, because I'm not sure if it's preferable to address this as a note in the documentation (certainly the easier way), or if it would be better to make it so that it works without the asterisk, if that's possible?
In case it makes a difference, I'm using the WithValidation concern along with WithBatchInserts and WithChunkReading.
Would prefer a note in the docs for now. I think it's probably tricky to solve this for all possible validation rules.
Thanks for the response @patrickbrouwers! I've submitted a suggested note as a PR to the docs, so I'll go ahead and close this question.