Level 51
Does this help
I have tow models with many to many relationship . posts and tags (tag labels for each post). I tried to paginate posts with this code in repository but doesn't work . what this the problem ?
public function getTagsWithPosts($tagId,$rowsCount)
{
return $this->tag->where('id',$tagId)->with(['posts' => function($q) use ($rowsCount){
$q->paginate($rowsCount);
}])->get();
}
Please or to participate in this conversation.