Custom Validation Rule not showing failure message in File upload field.

Hello all. I was trying to make a custom validation rule for a file upload field, but this was returned instead of the correct error message: Illuminate\Validation\ClosureValidationRule. So i thought of making a rule class but when I do that the path of the rule is returned instead. Below is my code for the file upload field:
Forms\Components\FileUpload::make('data')
->required()
->maxSize(128000)
->rules([new DataValidationRule()])
->hidden(function (Get $get) {
$type = $get('type');
return $type === TypeEnum::WITH_WEIGHTS->value;
}),
Forms\Components\FileUpload::make('data')
->required()
->maxSize(128000)
->rules([new DataValidationRule()])
->hidden(function (Get $get) {
$type = $get('type');
return $type === TypeEnum::WITH_WEIGHTS->value;
}),
2 Replies
Srccode
SrccodeOP7mo ago
Anyone?
toeknee
toeknee7mo ago
where is your DataValidationRule ?
Want results from more Discord servers?
Add your server