title: How to delete data in 3 relation table in laravel 5.7
body: <p>I am trying to delete data on 3 relation table using laravel 5.7, when I am trying it on 2 relation table, it's run well, but when I'm trying it in 3 relation table, it does not work.</p>
  
  <p>this is my table look like:</p>
  
  <p><strong>table 1 : group_access</strong></p>
  
  <pre>
  |----|------------|
  | id | group_name |
  |----|------------|
  | 67 |     test   |
  |----|------------|
  </pre>   
  
  <p><strong>table 2 : fa_group_access</strong></p>
  
  <pre>
  |----|-----------------|--------|
  | id | group_access_id | name   |
  |----|-----------------|--------|
  |  1 |     67          | john   |
  |----|-----------------|--------|
  </pre>        
  
  <p><strong>table 3 : survey_group_access</strong></p>
  
  <pre>
  |----|-----------------|---------------|
  | id | group_access_id | code_survey   |
  |----|-----------------|---------------|
  |  1 |     67          | SF-001        |
  |----|-----------------|---------------|
  </pre>       
  
  <p>and this is my function in the controller to delete the data:</p>
  
  <pre><code>public function destroy($id)
  {
      $group = Groups::findOrFail($id);
  
      if($group-&gt;delete())
      {   
          Survey_group_access::where('group_access_id', $id)-&gt;get();
          FA_Group_Access::where('group_access_id', $id)-&gt;get();
          return response()-&gt;json(['status'=&gt;'success']);    
      }   
  }
  </code></pre>
  
  <p>and i got an error sql like this :</p>
  
  <blockquote>
    <p>SQLSTATE[23000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL
    Server]The DELETE statement conflicted with the REFERENCE constraint
    "survey_group_access_group_access_id_foreign". The conflict occurred
    in database "aetra2", table "dbo.survey_group_access", column
    'group_access_id'. (SQL: delete from [group_access] where [id] = 67)</p>
  </blockquote>
  
  <p>How to fix this error?</p>