Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ added validation customAttributes #7

Merged
merged 3 commits into from
Feb 15, 2023

Conversation

fabianmieller
Copy link
Contributor

Laravel allows the use of customAttributes for validation messages.

With my pr, I added the ability to add a "customAttribute" to the option.

$this->option('contact.email', 'required|email', [], 'E-Mail-Address')->verify();

Response without customAttributes

{
    "status": "error",
    "errors": [
        {
            "status": 400,
            "message": "contact.email",
            "detail": "Contact.email ist ein Pflichtfeld."
        }
    ]
}

Response without customAttributes

{
    "status": "error",
    "errors": [
        {
            "status": 400,
            "message": "contact.email",
            "detail": "E-Mail-Adresse ist ein Pflichtfeld."
        }
    ]
}

@acidjazz
Copy link
Member

acidjazz commented Feb 15, 2023

great feature @fabianmieller ! appreciate the PR! if you have time to update the readme with an example that would be great - if not no problem i can merge this later today

@fabianmieller
Copy link
Contributor Author

Thanks @acidjazz
I added an example

@acidjazz acidjazz merged commit 52c544d into fumeapp:master Feb 15, 2023
@acidjazz
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants