renoki-co/laravel-eloquent-query-cache

Relationship belongsToMany doesn't work

muratcakmakjengal opened this issue ยท 9 comments

Hello, I encountered a problem, Can you help ?

image

image

image

How I can fixed ?
There is my fault ?

Caching for many-to-many doesn't work yet.

Ty for answer. We are waiting new version ๐Ÿ‘

same for belongsTo I assume?

[2021-06-30 14:10:11] testing.ERROR: Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsTo::cacheFor() {"exception":"[object] (BadMethodCallException(code: 0): Call to undefined method Illuminate\\Database\\Eloquent\\Relations\\BelongsTo::cacheFor() at ..../vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50)

@DeepDiver1975 I have spent a lot of time finding out what the issue was. None found. The BelongsTo, like any other relationship that extends the Relation class, proxies the calls to the query builder underneath. This means that it should work if all models got set properly.

@rennokki Hello, Caching for many-to-many will it come ? โ…Žโ…Ž

@DeepDiver1975 I have spent a lot of time finding out what the issue was. None found. The BelongsTo, like any other relationship that extends the Relation class, proxies the calls to the query builder underneath. This means that it should work if all models got set properly.

@rennokki THX a lot for looking into this - I finally got this working (I honestly don't remember what fixed this ๐Ÿ™ˆ )
Sending some virtual ๐Ÿป .... THX

@muratcakmakjengal The latest version contains it. #78, issue: #53

@DeepDiver1975 I can hear the cling sounds ๐Ÿป Got more time for open source from now on.

By the way, documentation moved to Gitbook, and the documentation for Many-to-many flush is here: https://leqc.renoki.org/cache-tags/cache-invalidation/many-to-many-automatic-cache-invalidation