protected function detachUsingCustomClass($ids)
    {
        $results = 0;

        foreach ($this->parseIds($ids) as $id) {
            $results += $this->newPivot([
                $this->foreignPivotKey => $this->parent->{$this->parentKey},
                $this->relatedPivotKey => $id,
            ], true)->delete();
        }

        return $results;
    }
protected function detachUsingCustomClass($ids)
    {
        $results = 0;

        foreach ($this->parseIds($ids) as $id) {
            $results += $this->newPivot([
                $this->foreignPivotKey => $this->parent->{$this->parentKey},
                $this->relatedPivotKey => $id,
            ], true)->delete();
        }

        return $results;
    }
protected function detachUsingCustomClass ( $ ids ) { $ results = 0 ; foreach ( $ this -> parseIds ( $ ids ) as $ id ) { $ results += $ this -> newPivot ( [ $ this -> foreignPivotKey => $ this -> parent -> { $ this -> parentKey } , $ this -> relatedPivotKey => $ id , ] , true ) -> delete ( ) ; } return $ results ; }
Detach models from the relationship using a custom class.

@param  mixed  $ids
@return int
Detach models from the relationship using a custom class .