/**
  * Detach models from the relationship.
  *
  * @param  int|array  $ids
  * @param  bool  $touch
  * @return int
  */
 public function detach($id = array(), $touch = true)
 {
     if (!$id instanceof Model and !$id instanceof Collection) {
         $id = $this->modelsFromIds($id);
     } elseif (!is_array($id)) {
         $id = [$id];
     }
     // Prepare for a batch operation to take place so that we don't
     // overwhelm the database with many delete hits.
     $this->finder->prepareBatch();
     foreach ($id as $model) {
         $edge = $this->edge($model);
         $edge->delete();
     }
     $results = $this->finder->commitBatch();
     if ($touch) {
         $this->touchIfTouching();
     }
     return $results;
 }