title: Laravel Eloquent ORM - Many to Many Delete Pivot Table Values left over
body: <p>Using Laravel, I have the following code</p>
  
  <pre><code>$review = Review::find(1);
  $review-&gt;delete();
  </code></pre>
  
  <p><code>Review</code> has a many to many relationship defined with a <code>Product</code> entity. When I delete a review, I'd expect it to be detached from the associated products in the pivot table, but this isn't the case. When I run the code above, I still see the linking row in the pivot table.</p>
  
  <p>Have I missed something out here or is this the way Laravel works? I'm aware of the <code>detach()</code> method, but I thought that deleting an entity would also detach it from any related entities automatically.</p>
  
  <p><code>Review</code> is defined like this:</p>
  
  <pre><code>&lt;?php
  class Review extends Eloquent
  {
      public function products()
      {
          return $this-&gt;belongsToMany('Product');
      }
  }
  </code></pre>
  
  <p><code>Product</code> is defined like this:</p>
  
  <pre><code>&lt;?php
  class Product extends Eloquent
  {
      public function reviews()
      {
          return $this-&gt;belongsToMany('Review');
      }
  }
  </code></pre>
  
  <p>Thanks in advance.</p>