title: how to delete data in laravel 5.4 through third model relation
body: <p>I am new in laravel and using laravel version 5.4.
  I have three model named Projects, Tasks, and TaskStatus.</p>
  
  <pre><code>`class Project extends Model {
      public function tasks() {
          return $this-&gt;hasMany('App\Models\Task', 'project_id', 'id');
      }
  }`
  </code></pre>
  
  <p>and second model as </p>
  
  <pre><code>`class Task extends Model {
      public function taskStatus() {
          return $this-&gt;hasMany('App\Models\TaskStatus', 'task', 'id');
      }
   }`
  </code></pre>
  
  <p>I am trying to delete all status like this:</p>
  
  <pre><code>$this-&gt;project-&gt;find($project_id)-&gt;tasks()-&gt;taskStatus()-&gt;delete();
  </code></pre>
  
  <p>it shows me error like this:
  Call to undefined method Illuminate\Database\Query\Builder::taskAssign()</p>
  
  <p>How can I solve this error?</p>