Skip to content

Caching of LazyLoaded Relationships #127

Closed
@jradtilbrook

Description

@jradtilbrook

Issue

From the README and video I am trying to cache a belongsToMany relationship but it doesn't seem to be working. In my set up caching other relationships does work such as hasOne, hasMany and belongsTo but the many-to-many case does not.

I have had a brief look through the code but I am not following where either it or I could be going wrong. The documentation states that adding the Cachable trait just works including relationships.

I do note however, that the test for relationships only seems to test a single type (many-to-one).

Also note that eagerly loading a relationship does appear to work (ie. using with()) whereas lazy loading does not.

I would appreciate any help. Let me know if you need more info.

PS. This is an awesome library!

Environment

Laravel Version: 5.6.*
Laravel Model Caching Package Version: 0.2.57
PHP Version: 7.2
Homestead Version: N/A
Operating System & Version: ArchLinux

Stack Trace

N/A

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions