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

Fixes query attribute not existing under strict mode #465

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daika7ana
Copy link

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
Copy link

Thanks for this fix. Solved the issue for me.

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