title: Belongs to pivot table in Laravel 5
body: <p>Let's say I'm having the following database schema:</p>
  
  <p><a href="https://i.stack.imgur.com/Fnm1e.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Fnm1e.png" alt="enter image description here"></a></p>
  
  <p><code>dogs</code> and <code>owners</code> are connected with classic <code>belongsToMany</code>. How about the <code>walks</code> table? I'd like to be able to use Eloquent goodies in such kind of relationship:</p>
  
  <pre><code>$dogs = Dog::with('walks')-&gt;get();
  $walks = Walk::with('dogs')-&gt;get();
  </code></pre>
  
  <p>In theory, I could replace <code>dog_owner_id</code> with two separate columns: <code>dog_id</code> and <code>owner_id</code>. That would make it easy to use Eloquent, but I'd lose some data integrity, because unrelated Dog and Owner could potentially go for a walk (and that's not safe for neither!).</p>
  
  <p>In <em>Walk.php</em>, how should the relations be defined?</p>
  
  <pre><code>public function dog() {
      // return ???;
  }
  </code></pre>
  
  <p>How about <em>Dog.php</em> and <em>Owner.php</em>?</p>
  
  <pre><code>public function walks() {
      // return ???;
  }
  </code></pre>