Can't figure out how to design relational query
I have three tables
Relationships:
Problem: Cannot paginate the products using limit and offset as offset is only available for the top level relation which here is categories.
Problem: Cannot filter on the basis of category_slug since is not available inside nested
How can achieve the result I want using the relation queries?
- categories
- products
- media
Relationships:
- Many products can belong to one category (products - categories = Many-to-one)
- Many products can have many images (products - images = Many-to-Many)
Problem: Cannot paginate the products using limit and offset as offset is only available for the top level relation which here is categories.
Problem: Cannot filter on the basis of category_slug since is not available inside nested
category I guess because this is a Many-to-one relation.How can achieve the result I want using the relation queries?