Use remember either on the relationship definition:
public function someRelation()
{
return $this->hasMany('Model')->remember(2);
}
or the relation loading itself:
Model::with([
'first' => function ($q) {$q->remember(2);}
'second' => ...
])
->orderBy('title')
->remember(2,'domain.query')
->get()
jarektkaczyk said:
Use remember either on the relationship definition:
public function someRelation() { return $this->hasMany('Model')->remember(2); }
or the relation loading itself:
Model::with([ 'first' => function ($q) {$q->remember(2);} 'second' => ... ]) ->orderBy('title') ->remember(2,'domain.query') ->get()
Thank you for your solution :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community