0

I have the following query which retrieves the child configuration records (confch) associated with the parent configuration (confp) and it works fine.

$data["items"] = Confp::find(decrypt($type))->Confch;

I just need to paginate the results.

adding ->paginate(10) would definitly not work as it does not exist in the resulting collection. I found nothing helping in the laravel documentation.

How can I do that please?

M Reza Saberi
  • 7,134
  • 9
  • 47
  • 76

1 Answers1

0

Try this instead of above code.

$confp = Confp::find(decrypt($type));
$data["items"] = $confp->setRelation('Confch',$confp->Confch()->paginate(10));
Suraj15689
  • 29
  • 4