title: Laravel "backwards" foreign key delete using controller
body: <p>The problem I'm having is that I'm trying to make it so when I delete a users account, all the things accociated with the account get deleted to. The problem here is that, in my table where the users information is saved, has no foreign key references, they all come from other tables <strong>towards</strong> my users table.</p>
  
  <p>Here is an example (links, because I'm not high enough to post images): </p>
  
  <p><a href="https://i.stack.imgur.com/Kdvvm.png" rel="nofollow noreferrer">Foreign examaple</a></p>
  
  <p>My problem (pink is what i have, blue is what i want), made simple (in paint):</p>
  
  <p><a href="https://i.stack.imgur.com/FgmzT.png" rel="nofollow noreferrer">Problem example</a></p>
  
  <p>Here is my view code for the delete button:</p>
  
  <pre><code>&lt;th&gt; &lt;a href="/instagramDelete/{{$instagramAccount-&gt;id}}"&gt; &lt;button class="btn btn-danger btn-circle btn-sm"&gt;&lt;i class="fas fa-trash"&gt;&lt;/i&gt;&lt;/button&gt; &lt;/a&gt; &lt;/th&gt;
  </code></pre>
  
  <p>Code from my controller:</p>
  
  <pre><code>public function delete($id)
      {
          DB::table('instagram_accounts')-&gt;where('id', $id)-&gt;delete();
  
          return redirect('/instagram');
      }
  </code></pre>
  
  <p>(only works if other pages accociated with the user have no data from said user)</p>
  
  <p>Code from my web (I have no idea if I need to include this here):</p>
  
  <pre><code>Route::get('/instagramDelete/{id}', 'InstagramAccountController@delete')-&gt;middleware('auth');
  </code></pre>
  
  <p>Code from my model:</p>
  
  <pre><code>class InstagramAccount extends Model
  {
      public function configuration()
      {
          return $this-&gt;hasOne(Configuration::class, 'account_id');
      }
  }
  </code></pre>
  
  <p>I hope this is enough for you to know what I mean, because i think this question is kinda vague.</p>
  
  <p>If you need any more code or something, please ask.</p>
  
  <p>As always, thanks in advance!</p>