LMongo\Eloquent\Model::newInstance PHP Method

newInstance() public method

Create a new instance of the given model.
public newInstance ( array $attributes = [], boolean $exists = false ) : Model
$attributes array
$exists boolean
return Model
    public function newInstance($attributes = array(), $exists = false)
    {
        // This method just provides a convenient way for us to generate fresh model
        // instances of this current model. It is particularly useful during the
        // hydration of new objects via the Eloquent query builder instances.
        $model = new static((array) $attributes);
        $model->exists = $exists;
        return $model;
    }
Model