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

[5.4] Add ability to pass accepted values as argument list #19555

Merged
merged 1 commit into from
Jun 11, 2017
Merged

[5.4] Add ability to pass accepted values as argument list #19555

merged 1 commit into from
Jun 11, 2017

Conversation

KKSzymanowski
Copy link
Contributor

This adds ability to pass the allowed(or not allowed) values for in and notIn rules as argument list instead of an array(like Model::with()).

For example:

Rule::in('foo', 'bar', 'baz');

will be equivalent to:

Rule::in(['foo', 'bar', 'baz']);

The values, even if they are not necessarily strings, are being cast to strings in the implode call in Illuminate\Validation\Rules\In::__toString(), so I think the array|string parameter hint is OK. Another option would be to just call it mixed.

@taylorotwell taylorotwell merged commit a76b08d into laravel:5.4 Jun 11, 2017
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.

2 participants