title: Laravel hasManyThrough equivalent: belongsTo relationship through another model
body: <p>I've got a model, it belongs to another model, that model belongs to a third model, and I want an eloquent method to relate the first model to the third one.</p>
  
  <p>There doesn't appear to be a belongsToThrough (or hasOneThrough) method, though. I've already tried chaining multiple <code>belongsTo</code> methods, but that hasn't worked (<code>Call to undefined method Illuminate\Database\Query\Builder::belongsTo()</code>). Any ideas?</p>
  
  <p>Here is an example of the models:</p>
  
  <pre><code>// The first model
  // Schema: this model has a middle_id column in the database
  class Origin extends Eloquent {
      public function middle()
      {
          return $this-&gt;belongsTo('Middle');
      }
  }
  
  // The second model
  // Schema: this model has a target_id column in the database, but NOT an origin_id column
  class Middle extends Eloquent {
      public function target()
      {
          return $this-&gt;belongsTo('Target');
      }
  }
  
  // The third model
  class Target extends Eloquent {
  }
  </code></pre>
  
  <p>What I'd like to do is add something like the following method to the <code>Origin</code> model:</p>
  
  <pre><code>// A relationship method on the first "origin" model
  public function target()
  {
      // First argument is the target model, second argument is the middle "through" model, third argument is the database column in middle model that it uses to find the target model, or soemthing
      return $this-&gt;hasOneThrough('Target', 'Middle', 'target_id');
  }
  </code></pre>
  
  <p>So that I can use <code>$originInstance-&gt;target-&gt;title</code>, etc.</p>