title: Eloquent hasMany with foreign key on joint table
body: <p>Assume this:</p>
  
  <pre><code>class List extends Model
  {
      public function items(){
          return $this-&gt;hasMany(Items::class, 'c.class_id', 'class_id')
              -&gt;rightjoin('items_classes as c', 'c.items_id', '=', 'items.id');
      }
  }
  </code></pre>
  
  <p>The problem is that Eloquent prepends <code>items</code> to foreign key field and the final query is:</p>
  
  <pre><code>SELECT * FROM items
  RIGHT JOIN items_classes as c ON c.items_id = items.id
  // here it is
  WHERE items.c.class_id = 10
  </code></pre>
  
  <p>Even using <code>DB::raw('c.class_id')</code> didn't solve the problem.</p>