lundi 2 octobre 2017

How to cache relation on laravel 5.5

here is in my controller

$posts = Post::where(array('status' => Post::STATUS_PUBLISHED))
            ->with('inners')
            ->orderBy('created_at', 'DESC')->paginate(8);

here is my relation

public function inners()
    {
        return $this->hasMany(PostInner::class)->orderBy('position');
    }

I tried to use remember but it's deprecated

How to cache only relation inners?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire