title: Laravel Eloquent pagination on relationships
body: <p>I am trying to paginate a Eloquent relationship like this:</p>
  
  <pre><code> $query = Product::find(1)-&gt;options()-&gt;paginate();
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>Fatal error: Call to a member function getCurrentPage() on a non-object
  </code></pre>
  
  <p>I have confirmed that the code <code>$query = Product::find(1)-&gt;options()</code> returns a collection of options. The <code>$query</code> object seems to be of type <code>hasMany</code>. Below are the model classes I am using.</p>
  
  <pre><code>class Product extends Eloquent
  {
  
      protected $table = 'products';
  
      public function options ()
      {
          return $this-&gt;hasMany('ProductOption', 'product_id');
      }
  }
  
  class ProductOption extends Eloquent
  {
      protected $table = 'product_options';
  
      public function product()
      {
          return $this-&gt;belongsTo('Product', 'product_id');
      }
  }
  </code></pre>
  
  <p>Does eloquent not return paginated results for relationships?</p>