Appearance
Validation rule
Always use array notation (avoid using | as separator for validation rules). Using an array notation will make it easier to apply custom rule classes to a field.
diff
public function rules(): array
{
return [
- 'email' => 'required|email',
+ 'email' => ['required', 'email'],
];
}Custom rules
- Prefer class-based custom
Rules. - Consider extract repeatable validation rules to a separate class (there is a great validation-composite package for that).