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

Ajvanho's avatar
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!');
        }
    }
0 likes
0 replies

Please or to participate in this conversation.