Closed chuoke closed 3 years ago
The 'attribute' should not be replaced. Laravel's behavior should be used.
For example:
public function rules() { return [ 'attachments.*.type' => [new EnumRule(AttachmentType::class)], ]; } public function attributes() { return [ 'attachments.*.type' => 'Attachment type', ]; }
The error message: Before
The attachments.0.type field is not a valid Rules\AttachmentType.
After
The Attachment type field is not a valid Rules\AttachmentType.
And we can publish translation and change it
The :attribute is not valid.
will be
The Attachment type is not valid.
https://github.com/spatie/laravel-enum/releases/tag/2.5.2
The 'attribute' should not be replaced. Laravel's behavior should be used.
For example:
The error message: Before
After
And we can publish translation and change it
will be