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

[9.x] Add "lowercase" validation rule #44883

Merged
merged 2 commits into from Nov 8, 2022
Merged

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Nov 8, 2022

This PR introduces a "lowercase" validation rule.

We have a current want for this rule to create some standardised data formatting without changing the case on the user silently.

For example, we want a user to be able to create a database user, but we want to force the user to lowercase.

Usage

Validator::make(['name' => 'Admin'], ['name' => 'required|string|lowercase']);

I don't have a real usecase for an "uppercase" rule, so I did not include it. If we want it for consistency, I can follow up with one (or someone else is welcome to add it).

Documentation: laravel/docs#8332

@taylorotwell taylorotwell merged commit c3ed678 into laravel:9.x Nov 8, 2022
@GrahamCampbell GrahamCampbell changed the title Adds "lowercase" validation rule [9.x] Add "lowercase" validation rule Nov 8, 2022
@timacdonald timacdonald deleted the lowercase branch January 10, 2023 01:24
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