public function cascade($models, $direction, array $directionData = [])
    {
        try {
            $this->direction = $direction;
            $this->directionData = $directionData;
            $this->run($models);
            //All ok we commit all database queries
            foreach ($this->dbsToTransact as $connectionToTransact) {
                DB::connection($connectionToTransact)->commit();
            }
        } catch (\Exception $e) {
            //Rollback the transaction before throw exception
            foreach ($this->dbsToTransact as $connectionToTransact) {
                DB::connection($connectionToTransact)->rollBack();
            }

            throw new SoftCascadeLogicException($e->getMessage(), null, $e);
        }
    }
public function cascade($models, $direction, array $directionData = [])
    {
        try {
            $this->direction = $direction;
            $this->directionData = $directionData;
            $this->run($models);
            //All ok we commit all database queries
            foreach ($this->dbsToTransact as $connectionToTransact) {
                DB::connection($connectionToTransact)->commit();
            }
        } catch (\Exception $e) {
            //Rollback the transaction before throw exception
            foreach ($this->dbsToTransact as $connectionToTransact) {
                DB::connection($connectionToTransact)->rollBack();
            }

            throw new SoftCascadeLogicException($e->getMessage(), null, $e);
        }
    }
public function cascade ( $ models , $ direction , array $ directionData = [ ] ) { try { $ this -> direction = $ direction ; $ this -> directionData = $ directionData ; $ this -> run ( $ models ) ; //All ok we commit all database queries foreach ( $ this -> dbsToTransact as $ connectionToTransact ) { DB :: connection ( $ connectionToTransact ) -> commit ( ) ; } } catch ( \ Exception $ e ) { //Rollback the transaction before throw exception foreach ( $ this -> dbsToTransact as $ connectionToTransact ) { DB :: connection ( $ connectionToTransact ) -> rollBack ( ) ; } throw new SoftCascadeLogicException ( $ e -> getMessage ( ) , null , $ e ) ; } }
Cascade over Eloquent items.

@param Illuminate\Database\Eloquent\Model $models
@param string                             $direction     update|delete|restore
@param array                              $directionData

@return void
Cascade over Eloquent items .