title: Laravel 5: cascade soft delete
body: <p>I am having <strong>offers</strong> and <strong>services</strong> table. </p>
  
  <p>Service(s) is a child of an offer. So far I have established functionality for soft deleting an offer. How would I also soft delete appended services? Here is my code:</p>
  
  <p>Migration Offers</p>
  
  <pre><code>Schema::create('offers', function(Blueprint $table)
  {
      $table-&gt;increments('id')-&gt;unsigned();
      ...    
      $table-&gt;timestamps();
      $table-&gt;softDeletes();
  });
  </code></pre>
  
  <p>Migration Services</p>
  
  <pre><code>Schema::create('services', function(Blueprint $table) 
  {
      $table-&gt;increments('id');
      $table-&gt;integer('offer_id')-&gt;unsigned();   
      ...
      $table-&gt;timestamps();
      $table-&gt;softDeletes();
  });
  
  Schema::table('services', function($table) 
  {
      $table-&gt;foreign('offer_id')
            -&gt;references('id')
            -&gt;on('offers');
  });
  </code></pre>
  
  <p>Model Offer</p>
  
  <pre><code>use SoftDeletes;
  protected $dates = ['deleted_at'];
  
  public function services() {
      return $this-&gt;hasMany('App\Service');
  } 
  </code></pre>
  
  <p>Model Service</p>
  
  <pre><code>public function offer() {
      return $this-&gt;belongsTo('App\Offer');
  } 
  </code></pre>
  
  <p>Delete method</p>
  
  <pre><code>public function destroy($id)
  {
      $offer = Offer::find($id);
      $offer-&gt;delete();
  }
  </code></pre>
  
  <p>Thank you for all the help.</p>