Hello all, I have a simple function (see below) in a model, i render content based on who the user is.
public function customcontent($userid)
{
$user = User::where('id', $userid)->sole();
if ($user->xmuser() == true) {
return $this->customdocs->sortByDesc('created_at');
}
if (count($user->xonly) > 0) {
$docs = Doc::where('userid', $user->id)->get();
return $docs->sortByDesc('created_at');
}
}
i can't seem to apply paginate() on these. My second issue is how I would implement links for pagination in blade file, as my content is rendered for each user. Do links accept custom variable as I have it?