title: How to specify pivot table for hasOne() relationship in Laravel
body: <p>I have a couple of models that I have included pivot tables for to avoid a polymorphic relation.</p>
  
  <pre><code>role table
  id
  name
  description
  
  restriction table
  id
  rule
  status
  
  restriction_role table
  id
  restriction_id
  role_id
  </code></pre>
  
  <p>Reason for this setup is that both Roles and Restrictions can actually belong to multiple other models. In this case, a Role can only have 1 Restriction. I would normally define this as</p>
  
  <pre><code>class Role extends Eloquent {
      public function restrictions()
      {
          return $this-&gt;hasOne('Restriction');
      }
  }
  </code></pre>
  
  <p>This obviously does not work because Laravel is unaware of the pivot table connecting this relation. I could easily accomplish this by using a many-to-many relationship instead, but this is not exactly how my model works. Not seeing anything in the documentation for defining this. Any thoughts?</p>