Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

StefanSchmalhaus's avatar

Standard validation rules are ignored when a custom validation rule is added

I have a Livewire upload form for CSV files using two standard validation rules and a custom validation object:

public function rules() {
   return [
      'csvFile' => ['file', 'mimes:txt,csv', new CsvRule]
   ];
}

The problem is that the first two rules are ignored. The validation immediately jumps into the custom CsvRule. This CsvRule works perfectly fine when used as the only validation rule:

public function rules() {
   return [
      'csvFile' => [new CsvRule]
   ];
}

Of course, if I only use the "file" and the "mimes" rules it also works. It's the combination of all three that doesn't work.

Any ideas?

0 likes
0 replies

Please or to participate in this conversation.