title: Laravel paginate items in multiple categories
body: <p>I have 2 tables, products and categories. Products belong to different categories, and categories are formed in tree structure that allows for parent category and child category relationship. So given a specific category, how should I write query to get paginated products that belong to this category and all its child categories?</p>
  
  <p>I forgot to mention that in my settings, products and categories are many to many relationship, there is a pivoting table named product_catrgory. </p>