title: Laravel Eloquent Cascading Deletes
body: <p>I am using Laravel 4.1 and am attempting a cascading delete. I am doing this as some of the delete methods remove associated assets stored on S3, so relying on DB cascade delete is not suitable.</p>
  
  <p>Say I have an Entry model which itself has an image and many associated Option's which also have images as shown below (cut down for brevity).</p>
  
  <pre><code>class Entry extends Eloquent {
      public function image()
      {
          return $this-&gt;morphOne('Image', 'imageable');
      }
  
      public function options()
      {
          return $this-&gt;hasMany('Option');
      }
  
      protected static function boot() {
          parent::boot();
  
          static::deleting(function($entry) {
              $image = $entry-&gt;image;
              if($image !== null) {
                  $image-&gt;delete();
              }
  
              $entry-&gt;options()-&gt;delete()
              //Option::where('entry_id', $entry-&gt;id)-&gt;delete(); This also doesn't work
          });
      }
  }
  
  class Option extends Eloquent {
  
      public function entry()
      {
          return $this-&gt;belongsTo('Entry');
      }
  
      public function image()
      {
           return $this-&gt;morphOne('Image', 'imageable');
      }
  
      protected static function boot() {
          parent::boot();
  
          static::deleting(function($option) {
              Log::info('Trying to delete an option object');
              $image = $option-&gt;image;
  
              if($image !== null) {
                  $image-&gt;delete();
              }
          });
      }
  }
  </code></pre>
  
  <p>Note : I am doing the delete as recommended in <a href="https://stackoverflow.com/a/14174356">this answer</a>.</p>
  
  <p>When I call $entry->delete() it will delete the image and the entry itself however the delete handler is never called on the options (I don't see it output to the log). However if instead I use the following in the Entries deleting function everything works fine. </p>
  
  <pre><code>foreach($entry-&gt;options as $option) {
      $option-&gt;delete();
  }
  </code></pre>
  
  <p>Why doesn't $entry->options()->delete() work? Is this a bug in Laravel or have I made a mistake.</p>