src/Traits/HandlesEloquentRelationManipulationTrait.php
public function sync(Model $model, $relation, $ids, $detaching = true)
    {
        return $model->{$relation}()->sync($ids, $detaching);
    }
public function sync(Model $model, $relation, $ids, $detaching = true)
    {
        return $model->{$relation}()->sync($ids, $detaching);
    }
public function sync ( Model $ model , $ relation , $ ids , $ detaching = true ) { return $ model -> { $ relation } ( ) -> sync ( $ ids , $ detaching ) ; }
Executes a sync on the model provided

@param  Model $model
@param  string   $relation name of the relation (method name)
@param  array    $ids      list of id's to connect to
@param bool      $detaching
@return
Executes a sync on the model provided