title: Laravel : pagination with limit and page number on API
body: <p>I have a query where can i get all the data from related tables and get total <code>10 rows</code>.Now i want to set pagination parameter  in my query. if my <code>pagenumber=1</code> and <code>limit=2</code> it returns <code>1 and 2 rows</code> data with <code>page=1</code> and <code>limit=2</code>, If I am sending <code>page-3</code> and <code>limit-2</code> it returns <code>5 and 6 rows</code> and <code>page-3</code>.if <code>page=null</code> and <code>limit=null</code> return all data.</p>
  
  <p>How can I do this.</p>
  
  <p>My Function :</p>
  
  <pre><code>Post::with(['product.categories.attributes'])-&gt;whereStatus("Active")-&gt;get();
  </code></pre>
  
  <p>Also how can i pass this in <code>POSTMAN</code> </p>