mardi 23 juillet 2019

How to paginate the query results when using Laravel eloquent relationships

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?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire