title: Laravel - how to delete polymorphic relations of model with belongsTo relation?
body: <p>I have 4 tables. Two of them are <em>monomorphic</em> and two of them are <em>polymorphic</em>.</p>
  
  <p><strong>Monomorphic:</strong>
  Templates, Modules</p>
  
  <p><strong>Polymorphic:</strong>
  Documents, Images</p>
  
  <p>Now, <code>templates</code> and <code>modules</code> have both <code>documents</code> and <code>images</code> and each <code>Template</code> has many <code>Module</code>s and <code>modules</code> have foreign key that is set to cascade on deletion of <code>templates</code>.</p>
  
  <p>Now, if I delete a <code>Template</code> the associated <code>Module</code>s will be deleted but the associated polymorphic relations of <code>Module</code> will stay in Database. I haven't tried anything because I am completely clueless. </p>
  
  <p>Anything I could do to automatically delete associations of <code>Module</code> when <code>Template</code> is deleted? I think the deletion here in this is being handled by Database itself and Eloquent doesn't have anything to do with it.</p>