You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When laravel model caching enabled, I can't use eloquent taggable. Looks like there is a conflict with "tags" word.
I'm trying to update my post with new tags but there is an error: Call to undefined method Cviebrock\EloquentTaggable\Models\Tag::flushCache()
But taggable package doesn't have flushCache function.
@reasecret Thanks for reporting this. After looking through their code, I believe the problem is that the Tag model isn't part of caching. The idea solution would be to extend the Taggable class and add the use Caching; trait
However, the secondary problem is that this package should not be calling caching methods on non-cached models. I will implement a fix for that shortly.
@reasecret Could you give release 0.5.3 a try and let me know how that works?
Considerations
It should no longer try to call flushCache on non-cachable models. That means, of course, that without more additional work, the Tag model is not cached. It may be possible to extend the Tag model via the TagService, but I'm not sure about that, as I don't use that package.
I've updated the package to 0.5.3 and created another Tag model based on original Tag model. And added use Cachable. Looks like problem solved for now. Thanks for your quick reply and fix.
Describe the bug
When laravel model caching enabled, I can't use eloquent taggable. Looks like there is a conflict with "tags" word.
I'm trying to update my post with new tags but there is an error:
Call to undefined method Cviebrock\EloquentTaggable\Models\Tag::flushCache()
But taggable package doesn't have flushCache function.
Eloquent Query
Stack Trace
Environment
I tried to remove model caching and there was no problem. Do you have any suggestion for this?
The text was updated successfully, but these errors were encountered: