title: Laravel Eloquent: multiple foreign keys for relationship
body: <p>I am in the process of porting a project to Laravel.</p>
  
  <p>I have two database tables which are in a One-To-Many relationship with each other. They are joined by three conditions. How do I model this relationship in Eloquent? </p>
  
  <p>I am not supposed to modify the database schema, since it has to remain backwards compatible with other things.</p>
  
  <p>I have tried the following, but it doesn't work.</p>
  
  <p>The owning side:</p>
  
  <pre><code>use Illuminate\Database\Eloquent\Model;
  
  class Route extends Model
  {
      public function trips()
      {
          return $this-&gt;hasMany('Trip', 'route_name,source_file', 'route_name,source_file')
      }
  }
  </code></pre>
  
  <p>The inverse side:</p>
  
  <pre><code>use Illuminate\Database\Eloquent\Model;
  
  class Trip extends Model
  {
      public function routes()
      {
          return $this-&gt;belongsTo('Route', 'route_name,source_file', 'route_name,source_file');
      }
  }
  </code></pre>
  
  <p>Example <code>Route</code> database values:</p>
  
  <pre><code>id    | route_name     | source_file
  ---------------------------------------
  1     | Berlin - Paris | file1.xls   
  2     | Madrid - London| file2.xls
  3     | Berlin - Paris | file3.xls
  </code></pre>
  
  <p>Example <code>Trip</code> database values:</p>
  
  <pre><code>id        | route_name           | source_file | duration
  ---------------------------------------------------------
  1         | Berlin - Paris       | file1.xls   | 78
  2         | Madrid - London      | file2.xls   | 241
  3         | Berlin - Paris       | file3.xls   | 65
  1         | Berlin - Paris       | file1.xls   | 95
  1         | Berlin - Paris       | file1.xls   | 65
  </code></pre>
  
  <p><code>Route</code> and <code>Trip</code> have other attributes, which I did not include here for brevity.</p>
  
  <p>Is this possible in Eloquent?</p>