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

Fixed Enum usage in whereHasMorph condition when morph attribute casting #53839

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

Outsidaz
Copy link
Contributor

When using Laravel’s whereHasMorph condition with a model attribute that is a morph type and cast as an Enum, the following error occurs:

->whereHasMorph('relationName', '*', function ($query) { $query->where('status', SomeTypeEnum::Active); });

Cannot access offset of type SomeTypeEnum on array

This issue arises due to improper handling of Enum values in the query builder when the morph attribute is processed.

@taylorotwell taylorotwell merged commit 0365480 into laravel:11.x Dec 11, 2024
38 checks passed
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