title: Laravel 4, Eloquents pagination method
body: <p>Hello! I am having a problem when trying to use the paginate method on an eloquent model. The problem being that calling <code>{{ $model-&gt;links() }}</code> in my view file will throw me a <code>Call to undefined method Illuminate\Database\Query\Builder::links()</code> which didn't really get me anywhere due to it working perfectly on another view file.</p>
  
  <p>Controller.php</p>
  
  <pre><code>$data = Routine::whereHas('measurements', function($q)
                  {
                      $fra = str_replace("/","-", Input::get('fraDato'));
                      $fra = date('Y-m-d', strtotime($fra));
                      $til = str_replace("/","-", Input::get('tilDato'));
                      $til = date('Y-m-d', strtotime($til));
  
                      $q-&gt;whereBetween('date', array($fra, $til));
                  })-&gt;with('emps')-&gt;orderBy('date', 'time', 'title')-&gt;paginate(5);
  
                  return View::make('sok')
                  -&gt;with('title', 'Søk')
                  -&gt;with('date', $date)
                  -&gt;with('data', $data);
  </code></pre>
  
  <p>sok.blade.php</p>
  
  <pre><code>@if(isset($data))
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;ID&lt;/td&gt;
                  &lt;td&gt;Tittel&lt;/td&gt;
                  &lt;td&gt;Verdi&lt;/td&gt;
                  &lt;td&gt;Ansatt ID&lt;/td&gt;
                  &lt;td&gt;Dato&lt;/td&gt;
                  &lt;td&gt;Tid&lt;/td&gt;
                  &lt;td&gt;Basseng&lt;/td&gt;
              &lt;/tr&gt;
              @foreach($data as $data)
                  &lt;tr&gt;
                      &lt;td&gt;{{ $data-&gt;id }}&lt;/td&gt;
                      &lt;td&gt;{{ $data-&gt;measurements[0]-&gt;title }}&lt;/td&gt;
                      &lt;td&gt;{{ $data-&gt;value }}&lt;/td&gt;
                      &lt;td&gt;{{ $data-&gt;emps-&gt;user_name }}&lt;/td&gt;
                      &lt;td&gt;{{ date('d/m/Y', strtotime($data-&gt;date)) }}&lt;/td&gt;
                      &lt;td&gt;{{ $data-&gt;time }}&lt;/td&gt;
                      @foreach($data-&gt;measurements as $measurement)
                          &lt;td&gt;{{ $measurement-&gt;pivot-&gt;pool_id }}&lt;/td&gt;
                      @endforeach
                      &lt;td&gt;{{ HTML::linkRoute('edit_data', 'Rediger', $data-&gt;id) }}&lt;/td&gt;
                      &lt;td&gt;{{ HTML::linkRoute('delete_confirm', 'Slett', $data-&gt;id) }}
                      &lt;/td&gt;
                  &lt;/tr&gt;
              @endforeach
                     {{ $data-&gt;links() }}
  </code></pre>
  
  <p>Thanks!</p>