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

[11.x] make the Eloquent missing attribute handler more accurate by changing offsetExists #54654

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

koenvu
Copy link
Contributor

@koenvu koenvu commented Feb 17, 2025

We have recently implemented the Model::handleMissingAttributeViolationUsing callback in staging and production environments to allow the request to continue without exceptions, but still be notified about strict mode failures. However, due to the way the offsetExists method is currently implemented, we are getting a lot of false positives on missing attributes when using isset or ?? checks.

This PR aims to resolve that by temporarily disabling the check while retrieving the attribute, and then restoring it to the previous setting.

koenvu and others added 2 commits February 17, 2025 12:27

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@taylorotwell taylorotwell merged commit bf9c1ba into laravel:11.x Feb 17, 2025
41 checks passed
@koenvu koenvu deleted the better-exists branch February 17, 2025 15:39
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