Skip to content

Conversation

daika7ana
Copy link
Contributor

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.

@mikebronner mikebronner self-requested a review September 11, 2024 13:07
@mikebronner
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
Labels
None yet
3 participants