GiacomoM's avatar

Pagination in One To Many relationship

Hi, I have a model with an One To Many relationship, and I need to get 1 record of the main model with the pagination of the records of the relationships.

How can I do that?

Thanks

0 likes
3 replies
GiacomoM's avatar

I get this error:

Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation

GiacomoM's avatar

Does the name make difference?

I used your name "getRelationPaginationAttribute" and it worked.

Please or to participate in this conversation.