title: How to soft delete related records when soft deleting a parent record in Laravel?
body: <p>I have this invoices table that which has the following structure</p>
  
  <pre><code>id | name | amount | deleted_at
  2    iMac   1500   | NULL
  </code></pre>
  
  <p>and a payments table with the following structure</p>
  
  <pre><code>id | invoice_id | amount | deleted_at
  2    2            1000   | NULL
  </code></pre>
  
  <p>Invoice Model</p>
  
  <pre><code>class Invoice extends Model {
  
      use SoftDeletes;
  
  }
  </code></pre>
  
  <p>here's the code to delete the invoice </p>
  
  <pre><code>public function cance(Request $request,$id)
  {
      $record = Invoice::findOrFail($id);
      $record-&gt;delete();
      return response()-&gt;json([
          'success' =&gt; 'OK',
      ]);
  }
  </code></pre>
  
  <p>Payments model</p>
  
  <pre><code>class Payment extends Model {
  
      use SoftDeletes;
  
  }
  </code></pre>
  
  <p>The softDelete on Invoice table works perfectly but its related records (payments) still exists.How do I delete them using softDelete?</p>