src/Route/AbstractModelRoute.php
public function retrieveModel()
    {
        if ($this->model->persisted()) {
            return;
        }

        $modelClass = $this->modelClass;
        $this->model = $modelClass::find($this->modelId);

        if (!$this->model) {
            throw $this->modelNotFoundError();
        }
    }
public function retrieveModel()
    {
        if ($this->model->persisted()) {
            return;
        }

        $modelClass = $this->modelClass;
        $this->model = $modelClass::find($this->modelId);

        if (!$this->model) {
            throw $this->modelNotFoundError();
        }
    }
public function retrieveModel ( ) { if ( $ this -> model -> persisted ( ) ) { return ; } $ modelClass = $ this -> modelClass ; $ this -> model = $ modelClass :: find ( $ this -> modelId ) ; if ( ! $ this -> model ) { throw $ this -> modelNotFoundError ( ) ; } }
Retrieves the model associated on this class with
the persisted version from the data layer.

@throws InvalidRequest if the model cannot be found
Retrieves the model associated on this class with the persisted version from the data layer .