title: How to limit results per page in Yajra datatables
body: <p>How can I limit the results of data each page in Yajra datatables? Currently I'm using the code below:</p>
  <p><strong>Controller</strong></p>
  <pre><code>return Datatables::of(collect($results))-&gt;make(true);
  </code></pre>
  <p>The <code>$results</code> variable is just an array of data from database.</p>
  <p><strong>JS</strong></p>
  <pre><code>$('table.dataTableAjax').DataTable({
       &quot;processing&quot;: true, // Make this true, to show the &quot;Processing&quot; word while loading
       &quot;serverSide&quot;: true,
       &quot;paging&quot;: true,
       &quot;pageLength&quot;: 10,
       &quot;ordering&quot;: false, // Make this false, to disable sorting
       &quot;ajax&quot;: &quot;...&quot;
  });
  </code></pre>
  <p><strong>Example data from server</strong></p>
  <pre><code>{
      &quot;data&quot;:[
          { &quot;name&quot;: &quot;Bob&quot;, &quot;Age&quot;: 30 },
          { &quot;name&quot;: &quot;Billy&quot;, &quot;Age&quot;: 33 },
          { &quot;name&quot;: &quot;Megan&quot;, &quot;Age&quot;: 31 }
      ]
  }
  </code></pre>
  <p>So for example, the first page should load 10 rows, next page 10 rows again, and so on. But what's happening is it loads the 5000+ rows, and just cutting them into 10 table rows in client side which affects the performance of the application. Any idea?</p>