title: Overriding default foreign key and local key in Eloquent relationships Laravel 5
body: <p>I am confused about second and third arguments while defining eloquent relationships.</p>
  
  <pre><code>public function phone()
      {
  return $this-&gt;hasOne('App\Phone', 'foreign_key', 'local_key');
  }
  public function user()
  {
      return $this-&gt;belongsTo('App\User', 'foreign_key', 'other_key');
  }
  </code></pre>
  
  <p>I understand the second argument in both relationships, it is foreign key which will be same. However, I am confused about third argument about what it refers to? I have an assumption that this is the key to which foreign key refers so it would be same too in both relationships. I do not know whether I am right or wrong. Please elaborate the answer.</p>