Skip to content

Translated validation attributes #209

@justijndepover

Description

@justijndepover

I'm sorry if this has been asked before, but I can't seem to find an answer.

I validate my fields with the RuleFactory::make command. For example:

class CategoryRequest extends FormRequest
{
    public function rules()
    {
        return RuleFactory::make([
            '%name%' => ['required', 'string', 'max:255'],
            '%description%' => ['required', 'string'],
         ]);
    }
}

When I show the errors below the inputs, I get something like: fr.name is verplicht.
How can I translate the attribute name so fr.name is translated in the app locale (dutch in this case): naam

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions