protected function execute($relation, $foreignKey, $foreignKeyIds, $affectedRows)
    {
        $relationModel = $relation->getQuery()->getModel();
        $relationModel = new $relationModel();
        if ($affectedRows > 0) {
            $relationModel = $relationModel->withTrashed()->whereIn($foreignKey, $foreignKeyIds)->limit($affectedRows);
            $this->run($relationModel->get([$relationModel->getModel()->getKeyName()]));
            $relationModel->{$this->direction}($this->directionData);
        }
    }
protected function execute($relation, $foreignKey, $foreignKeyIds, $affectedRows)
    {
        $relationModel = $relation->getQuery()->getModel();
        $relationModel = new $relationModel();
        if ($affectedRows > 0) {
            $relationModel = $relationModel->withTrashed()->whereIn($foreignKey, $foreignKeyIds)->limit($affectedRows);
            $this->run($relationModel->get([$relationModel->getModel()->getKeyName()]));
            $relationModel->{$this->direction}($this->directionData);
        }
    }
protected function execute ( $ relation , $ foreignKey , $ foreignKeyIds , $ affectedRows ) { $ relationModel = $ relation -> getQuery ( ) -> getModel ( ) ; $ relationModel = new $ relationModel ( ) ; if ( $ affectedRows > 0 ) { $ relationModel = $ relationModel -> withTrashed ( ) -> whereIn ( $ foreignKey , $ foreignKeyIds ) -> limit ( $ affectedRows ) ; $ this -> run ( $ relationModel -> get ( [ $ relationModel -> getModel ( ) -> getKeyName ( ) ] ) ) ; $ relationModel -> { $ this -> direction } ( $ this -> directionData ) ; } }
Execute delete, or restore.

@param Illuminate\Database\Eloquent\Relations\Relation $relation
@param string                                          $foreignKey
@param array                                           $foreignKeyIds
@param int                                             $affectedRows

@return void
Execute delete or restore .