Skip to content

Checking custom validation messages not using translator has() function #53510

@petrzpav

Description

@petrzpav

Laravel Version

11

PHP Version

8.2

Database Driver & Version

No response

Description

The getCustomMessageFromTranslator function is using custom logic to check for translation messages instead of leveraging the translator's has() function.

This behavior causes an error when checking if a translation exists within the get function. Replacing this logic with the has() function would standardize the check and prevent such errors.

Reference: Laravel source

Steps To Reproduce

        $request->validate([
            'name' => 'required|string|max:255',
            'email' => 'required|email:rfc,dns|max:255|unique:users',
        ]);

Calling translator get() instead of translator has().

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