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

[8.x] Allow custom validation rules to use prepareValuesAndOthers() #36499

Closed
wants to merge 1 commit into from
Closed

[8.x] Allow custom validation rules to use prepareValuesAndOthers() #36499

wants to merge 1 commit into from

Conversation

jessarcher
Copy link
Member

Similar to #35183, I've needed to re-implement ValidatesAttributes::prepareValuesAndOthers() (and the two other methods it calls) on a few projects when implementing custom validation rules with true/false/null parameters.

So, I was wondering whether this method could be made public?

Alternatively, I could PR my prohibited_if custom validation rule that is basically the opposite of required_if and similar to exclude_if except that it fails validation instead of excluding the field. Not sure how common the use case is though.

No hard feelings if you prefer to keep this method private - totally understandable.

@driesvints driesvints changed the title Allow custom validation rules to use prepareValuesAndOthers() [8.x] Allow custom validation rules to use prepareValuesAndOthers() Mar 8, 2021
@driesvints
Copy link
Member

If we make this change we'll need to be aware it's a breaking change to the method signature.

@taylorotwell
Copy link
Member

I renamed this to parseDependentRuleParameters and made it public. 👍

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.

3 participants