renoki-co/laravel-eloquent-query-cache

Not compatible with ```Model::preventAccessingMissingAttributes()```

maciek-szn opened this issue · 7 comments

Laravel 9.35 introduced Model::preventAccessingMissingAttributes() option (laravel/framework#44283). However this package isn't quite compatible with this mechanism, as it sometimes returns an error: The attribute [cacheTags] either does not exist or was not retrieved for model...

I have opened #165, but it seems like the tests locally pass, even when I test for both false/true for strict mode.

Do you have any snippet from which the problem comes off?

I'll try to provide more information tomorrow. There might be Laravel Livewire involved.

It seems to me that there is a problem with passing a whole model to a Livewire component (see: Passing parameters). However the error isn't invoked on the first rendering of a Livewire component, only after refreshing it.

Should I open an issue in the Livewire repository? To be honest, I don't quite know what's going on under the hood and how the two libraries work together.

@maciek-szn I can test against livewire. Do you have any mockup component i can start from?

I've created a test repository.

@maciek-szn I was able to fix it. After 16 days. 😬

Thanks a lot!