Mar 1, 2022
0
Level 14
afterValidation message
How to make a custom error message, if I use aftervalidation hook ? I get standard error message 'there was a problem submitting the form custom message'
protected static function afterValidation(NovaRequest $request, $validator)
{
if (!$request->has('user', 'categories')) {
$validator->errors()->add('field', 'Resource must contain an author field and a category field!');
}
}
Please or to participate in this conversation.