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] Fix pure enums validation #45121

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

trckster
Copy link
Contributor

There was a problem when passing UnitEnum instance to the Enum rule, not BackedEnum. UnitEnum doesn't have tryFrom method, but in the first condition there is a check that such method exists.
Basically, what we should do is just swap first condition with the second. If $value instanceof $this->type is true, it is surely enum, no matter Backed or not.

@taylorotwell taylorotwell merged commit b6b4a19 into laravel:9.x Nov 28, 2022
bert-w pushed a commit to bert-w/framework that referenced this pull request Nov 28, 2022
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