title: How to paginate a collection after get() in Laravel?
body: <p>I have a merge on two query results which works fine:</p>
  
  <pre><code>$events1 = \App\Event::Where('valid_to','&gt;=',$today)-&gt;orderByRaw('valid_to','ASC')-&gt;get();
  $events2 = \App\Event::Where('valid_to','&lt;',$today)&gt;orderByRaw('valid_to','ASC')-&gt;get();
  $events = $events1-&gt;merge($events2); 
  </code></pre>
  
  <p>Now I need to paginate this new collection and as suggestted I added this piece:</p>
  
  <pre><code>$page = 1;
  $perPage = 60;
  $pagination = new \Illuminate\Pagination\LengthAwarePaginator(
      $events-&gt;forPage($page, $perPage), 
      $events-&gt;count(), 
      $perPage, 
      $page
  );
  </code></pre>
  
  <p>EDIT: For future readers, patricus's answer works great and I did that.</p>