title: Deleting related models one-to-many in Laravel
body: <p>Is this even possible? 
  In every tutorial that I read there is nothing about deleting, only selecting and inserting related models.</p>
  
  <p>This is my problem:</p>
  
  <p>I have three levels of nesting. I have classes Package, Level, Lesson and Phase, and their models are below. First one - packages:</p>
  
  <pre><code>class Package extends Eloquent  {
  
  protected $table = 'packages';
  public $timestamps = false;
  
  public function levels(){
      return $this-&gt;hasMany('Level', 'package_id');
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Levels:</p>
  
  <pre><code>class Level extends Eloquent  {
  
  protected $table = 'levels';
  
  public function lessons(){
      return $this-&gt;hasMany('Lesson', 'level_id');
  }
  
  public function package(){
      return $this-&gt;belongsTo('Package', 'package_id');
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Lessons:</p>
  
  <p>class Lesson extends Eloquent  {</p>
  
  <pre><code>protected $table = 'lessons';
  
  public function phases(){
      return $this-&gt;hasMany('Phase', 'lesson_id');
  }
  
  public function level(){
      return $this-&gt;belongsTo('Level', 'level_id');
  }
  </code></pre>
  
  <p>}</p>
  
  <p>What I'm trying to do here is to when deleting one package i delete all levels related to it and also to delete all lessons related to those levels.</p>
  
  <p>I have tried couple of options and they were all wrong, I just don't know how to do this without making a bunch of queries in foreach loop.
  Please, give some advice I'm so desperate I'm thinking about tweet to Jeffrey Way and ask him for the solution :) Thanks in advance </p>