The Wayback Machine - https://web.archive.org/web/20231128091736/https://github.com/laravel/framework/pull/49055
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

[10.x] Allow to pass Arrayable or Stringble in rules In and NotIn #49055

Draft
wants to merge 2 commits into
base: 10.x
Choose a base branch
from

Conversation

michaelnabil230
Copy link
Contributor

This PR adds the ability to Allow to pass Arrayable or Stringble in rules In and NotIn

request()->validate([
    'name' => ['required', 'string', 'min:6', In(collect(['Taylor', 'Michael', 'Tim']))],
    'password' => ['required', 'string', NotIn(collect(['12345', 'password']))],
]);
@taylorotwell
Copy link
Member

Why a string? Can you revert that?

@taylorotwell taylorotwell marked this pull request as draft November 20, 2023 18:43
@michaelnabil230
Copy link
Contributor Author

Hi @taylorotwell,

I added a string for if any developer can use this way

new In('1', '2', '3', '4');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants