title: Laravel - pagination links not appearing
body: <p>For some reason {{ $items->links() }} doesn't do anything.</p>
  
  <p>Direct cause of this problem is that $items->getLastPage() returns 0. Same $items->getTotal().</p>
  
  <p>I can change page parameter in the url and it works fine - it goes to correct page.
  however $items->getCurrentPage() returns 1 on each page.</p>
  
  <p>Pagination works perfectly for me with other models just this one gives me problems.</p>
  
  <p>Also it seems to be working fine when I create the paginator manually but I want to be able access some methods from the model so I want to use Eloquent models and not raw array.</p>
  
  <p><strong>Edited:</strong>
  Code:</p>
  
  <pre><code>$records = EventLog::byObject($model, $id)-&gt;paginate(10);
  
   static public function byObject($model, $id)
         {
  
             $records = DB::select([query], [params]);
             return self::getHistory($records, $model);
         }
  
   static public function getHistory($records, $model = '')
         {
             $ids = array();
              foreach ($records as $record) {
                  array_push($ids, (int)$record-&gt;id);
              }
  
              $history = array();                
  
              if (count($ids)) {
  
                  $history = EventLog::whereRaw('id IN (' . implode(',', array_fill(0, count($ids), '?')) . ')', $ids)
                  -&gt;with('creator')
                          -&gt;with(array('eventfields' =&gt; function($query)
                          {
                              $query-&gt;whereRaw('field NOT LIKE \'%_id\'');
                          }))
                          -&gt;orderBy('event_logs.created_at')
                          -&gt;orderByRaw('(CASE WHEN eventable_type=? THEN 0 ELSE 1 END)', array($model))
                          -&gt;orderByRaw('(CASE WHEN parent_type=? THEN 0 ELSE 1 END)', array($model));
  
              }
              return $history;
         }
  </code></pre>
  
  <p>The returned $history has the right type, is displayed correctly but the pagination is not working for some reason. </p>
  
  <p>I am trying to display links using</p>
  
  <pre><code>{{ $records-&gt;links(); }}
  </code></pre>
  
  <p>Thanks</p>