-
Notifications
You must be signed in to change notification settings - Fork 230
Question: Can I use this on a Pivot Model? #485
-
This is actually just a question.
I have created a Base Pivot Model which use laravel-model-caching like this:
<?php namespace App; use Illuminate\Database\Eloquent\Relations\Pivot; use GeneaLabs\LaravelModelCaching\Traits\Cachable; abstract class BasePivot extends Pivot { use Cachable; }
Then, from it I extend my Pivot Models.
<?php namespace App; use App\BasePivot; class UserPermission extends BasePivot { // }
It seems that every time the Pivot Model is called in a relationship, data is not cached as seen from debugbar.
public function permissions() { return $this->belongsToMany('App\Permission')->using('App\UserPermission'); }
What am I missing? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 5 comments
-
Hi @ferdiebergado, I'll have to look into this.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks mike. I'll be standing by for updates.
Beta Was this translation helpful? Give feedback.
All reactions
-
This is related to #127 .... so I won't have an answer for you anytime soon. But I'll keep this open. If anyone has the time to create a PR for this, that would be awesome!
Beta Was this translation helpful? Give feedback.
All reactions
-
Alright mike. I'll just use eager-loading for relationships for now. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
@ferdiebergado Hi there, I know it's been a while, but I might have good news. :) Would you mind testing the latest release and see if this works for you now?
Beta Was this translation helpful? Give feedback.