public function newModel($attributes = [], $model = null)
    {
        $model = (class_exists($model) ? $model : $this->schema->entryModel());

        if (! is_subclass_of($model, $base = Model::class)) {
            throw new InvalidArgumentException("The given model class '{$model}' must extend the base model class '{$base}'");
        }

        return new $model($attributes, $this->builder->newInstance());
    }
public function newModel($attributes = [], $model = null)
    {
        $model = (class_exists($model) ? $model : $this->schema->entryModel());

        if (! is_subclass_of($model, $base = Model::class)) {
            throw new InvalidArgumentException("The given model class '{$model}' must extend the base model class '{$base}'");
        }

        return new $model($attributes, $this->builder->newInstance());
    }
public function newModel ( $ attributes = [ ] , $ model = null ) { $ model = ( class_exists ( $ model ) ? $ model : $ this -> schema -> entryModel ( ) ) ; if ( ! is_subclass_of ( $ model , $ base = Model :: class ) ) { throw new InvalidArgumentException ( "The given model class '{$model}' must extend the base model class '{$base}'" ) ; } return new $ model ( $ attributes , $ this -> builder -> newInstance ( ) ) ; }
Creates a new model instance.

@param array       $attributes
@param string|null $model

@throws InvalidArgumentException

@return mixed|Entry
Creates a new model instance .