Skip to content

How to add the Custom validation messages in field in Nova resource ? #5408

@divya-kanak

Description

@divya-kanak

Hello,

In the resource file, How to add the Custom validation messages in the field in Nova resource?

I have one field as below, I need to add the validation message for required_if.

Multiselect::make('Roles', 'roles') ->placeholder('Choose an option) ->belongsToMany(\Pktharindu\NovaPermissions\Nova\Role::class, false) ->rules('required_if:is_admin,0'),

As I don't want to use the lang/en/validation.php which is generated by the system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions