public function updateModels(Models $models)
    {
        foreach ($models as $model) {
            if ($model->isSoftDeleted()) {
                $this->dispatchBeforeEvent($model, Event::DELETE);
            } else {
                $this->dispatchBeforeEvent($model, Event::UPDATE);
                $this->dispatchBeforeEvent($model, Event::SAVE);
            }
        }

        $this->updateAll()->executeModels($models);

        foreach ($models as $model) {

            $model->resetOriginals();

            if ($model->isSoftDeleted()) {
                $this->dispatchAfterEvent($model, Event::DELETE);
            } else {
                $this->dispatchAfterEvent($model, Event::UPDATE);
                $this->dispatchAfterEvent($model, Event::SAVE);
            }
        }

        return $this;
    }
public function updateModels(Models $models)
    {
        foreach ($models as $model) {
            if ($model->isSoftDeleted()) {
                $this->dispatchBeforeEvent($model, Event::DELETE);
            } else {
                $this->dispatchBeforeEvent($model, Event::UPDATE);
                $this->dispatchBeforeEvent($model, Event::SAVE);
            }
        }

        $this->updateAll()->executeModels($models);

        foreach ($models as $model) {

            $model->resetOriginals();

            if ($model->isSoftDeleted()) {
                $this->dispatchAfterEvent($model, Event::DELETE);
            } else {
                $this->dispatchAfterEvent($model, Event::UPDATE);
                $this->dispatchAfterEvent($model, Event::SAVE);
            }
        }

        return $this;
    }
public function updateModels ( Models $ models ) { foreach ( $ models as $ model ) { if ( $ model -> isSoftDeleted ( ) ) { $ this -> dispatchBeforeEvent ( $ model , Event :: DELETE ) ; } else { $ this -> dispatchBeforeEvent ( $ model , Event :: UPDATE ) ; $ this -> dispatchBeforeEvent ( $ model , Event :: SAVE ) ; } } $ this -> updateAll ( ) -> executeModels ( $ models ) ; foreach ( $ models as $ model ) { $ model -> resetOriginals ( ) ; if ( $ model -> isSoftDeleted ( ) ) { $ this -> dispatchAfterEvent ( $ model , Event :: DELETE ) ; } else { $ this -> dispatchAfterEvent ( $ model , Event :: UPDATE ) ; $ this -> dispatchAfterEvent ( $ model , Event :: SAVE ) ; } } return $ this ; }
Call all the events associated with model updates. Perform the update itself.

@param  Models           $models
@return Repo $this
Call all the events associated with model updates . Perform the update itself .