Create and return an un-saved instance of the related model.

@param  array  $attributes
@return \Globalis\PuppetSkilled\Database\Magic\Model
548253
public function make(array $attributes = [])
    {
        $instance = $this->related->newInstance($attributes);
        $this->setForeignAttributesForCreate($instance);
        return $instance;
    }
1123904
public function create(array $attributes)
    {
        if (!is_null($this->validator)) {
            // we should pass data that has been casts by the model
            // to make sure data type are same because validator may need to use
            // this data to compare with data that fetch from database.
            if( $this->versionCompare($this->app->version(), "5.2.*", ">") ){
                $attributes = $this->model->newInstance()->forceFill($attributes)->makeVisible($this->model->getHidden())->toArray();
            }else{
                $model = $this->model->newInstance()->forceFill($attributes);
                $model->addVisible($this->model->getHidden());
                $attributes = $model->toArray();
            }

            $this->validator->with($attributes)->passesOrFail(ValidatorInterface::RULE_CREATE);
        }

        $model = $this->model->newInstance($attributes);
        $model->save();
        $this->resetModel();

        event(new RepositoryEntityCreated($this, $model));

        return $this->parserResult($model);
    }
652847
public function newModelInstance($attributes = [])
    {
        return \tap(parent::newModelInstance($attributes), function ($model) {
            $model->setTenantor($this->tenantor);
        });
    }
334696
public function store(array $attributes)
    {

        $this->validate($attributes, 'store');

        $filtered = $this->toModelAttributes($this->make([]), $attributes);

        $this->callBeforeListeners('store', [&$attributes]);

        $model = $this->model()->createRoot($filtered);

        $this->callAfterListeners('store', [$model]);

        return $model;

    }
411365
public function create(array $attributes = [])
    {
        $instance = $this->model->newInstance($attributes)->setConnection(
            $this->query->getConnection()->getName()
        );

        $instance->save();

        return $instance;
    }
652461
public function newFromBuilder($attributes = [])
    {
        $instance = $this->newInstance([], true);

        $instance->setRawAttributes((array) $attributes, true);

        return $instance;
    }
1213951
public function entry(array $attributes = [])
    {
        $model = $this->schema->entryModel();

        return (new $model($attributes, $this->query));
    }
301990
public function getOrCreate(array $attributes)
    {
        $model = $this->get($attributes);
        if (null === $model) {
            $className = get_class($this->getModel());
            /** @var Model $model */
            $model = new $className($attributes);
            $model->save();

            return [$model, true];
        }

        return [$model, false];
    }
372964
public function container(array $attributes = [])
    {
        $model = $this->schema->containerModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), $this->schema->objectClassContainer());
    }
935405
public function create(array $attributes)
    {
        $this->applyAncestor();
        $this->applyCriteria();
        $this->applyScope();

        $model = $this->model->create($attributes);

        $model->save();

        $this->applyAfterSave($model);
        $this->resetModel();

        event(new RepositoryEntityCreated($this, $model));

        return $this->parserResult($model);
    }
1060008
public static function create($attributes = [])
    {
        try {
            self::init();
            foreach ($attributes as $column => $value) {
                $columns[] = $column;
                $values[] = ':'.$column;
            }

            $sql = 'INSERT INTO ' . self::$modelTable . ' (' . implode(',', $columns) . ') VALUES (' . implode(',', $values) . ')';
            $stm = self::$connect->prepare($sql);
            $stm->execute($attributes);
            return self::find(self::$connect->lastInsertId());
        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
        }
    }
560238
public function newModelInstance($attributes = [])
    {
        return $this->model->newInstance($attributes)->setConnection(
            $this->query->getConnection()
        );
    }
1147987
public static function fromArray(array $attributes) {
		unset($attributes['id']);
		
		$attributesObject = new self();
		
		foreach ($attributes as $key => $value) {
			$attributesObject->add($key, $value);
		}
		
		return $attributesObject;
	}
307958
public function replicate(array $attributes = [])
    {
        $copy = new static(array_merge($this->toArray(), $attributes));
        $copy->setConstraints(clone $this->getConstraints());
        return $copy;
    }
547103
public static function createOne(array $attributes)
    {
        return tap(new self($attributes), function (self $post) use ($attributes) {
            $post->save();

            $post->tags()->sync($attributes['tags']);

            $post->createSeo(
                static::extractSeoAttributes($attributes)
            );
        });
    }
329796
public function create($attributes = array())
    {
        $entity = $this->build($attributes);

        // to SQL.
        $criteria = $this->criteria();
        $sql = $criteria->toInsertSQL($attributes);

        // query.
        $sth = $this->query($sql, $criteria->getParams(), Database::TARGET_MASTER);
        if ($sth->isSuccess()) {
            $entity->exists = true;
            $entity->setPrimaryValue($sth->lastInsertId());
            return $entity;
        }
    }
446666
protected function _create(array $attributes)
    {
        $model = $this->newModelInstance()->forceFill($attributes);

        $model->save();

        return $model;
    }