Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixes query attribute not existing under strict mode #465

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

Merged
mikebronner merged 2 commits into mikebronner:master from daika7ana:master
Feb 26, 2025

Conversation

Copy link
Contributor

@daika7ana daika7ana commented Apr 16, 2024

When saving a model and Model::shouldBeStrict() is enabled, or to be more precise Model::preventAccessingMissingAttributes(), the $query attribute will not be accessible with the following error:

The attribute [query] either does not exist or was not retrieved for model [App\Models\ExampleModel].
{"userId":1,"exception":"[object] (Illuminate\\Database\\Eloquent\\MissingAttributeException(code: 0): 
The attribute [query] either does not exist or was not retrieved for model [App\\Models\\ExampleModel]. 
at /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:475)

This PR should fix this issue without impacting any functionality. Will solve #437.

SkyLundy reacted with thumbs up emoji
Copy link

Thanks for this fix. Solved the issue for me.

Copy link
Owner

need to get tests to run and pass

Signed-off-by: Mike Bronner <mike@genealabs.com>
@mikebronner mikebronner merged commit 83b2619 into mikebronner:master Feb 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@mikebronner mikebronner Awaiting requested review from mikebronner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /