code: public function detach($idParent, $idChild, $relation)
      {
          $parent = $this->find($idParent);
          
          $parent->$relation()->detach($idChild);
          
          return true;
      }
docs: Detach relation
  
  @return \Illuminate\Database\Eloquent\Model;