Create a new instance of the related model.

@param  array  $attributes
@return \Nova\Database\ORM\Model
165283
public function create(array $attributes)
    {
        $instance = $this->related->newInstance($attributes);

        $instance->setAttribute($this->getPlainForeignKey(), $this->getParentKey());

        $instance->save();

        return $instance;
    }
967188
public function create(array $attributes): bool
    {
        $model = $this->getModel();
        $model->setAttributes($attributes);

        return $model->save();
    }
993361
public function create(array $attributes = [])
    {
        return tap($this->related->newInstance($attributes), function ($instance) {
            $foreignKey = $this->getForeignKeyName();
            $parentKeyValue = $this->getParentKey();

            if (is_array($foreignKey)) { //Check for multi-columns relationship
                foreach ($foreignKey as $index => $key) {
                    $instance->setAttribute($key, $parentKeyValue[$index]);
                }
            } else {
                $instance->setAttribute($foreignKey, $parentKeyValue);
            }

            $instance->save();
        });
    }
1206762
public function newInstance($attributes = [], $exists = false)
    {
        $model = new static((array) $attributes, $this->parent, $this->table, $exists);
        $model->setPivotKeys($this->getForeignKey(), $this->getRelatedKey());
        return $model;
    }
298167
public function create(array $attributes)
    {
        $model = $this->getModelName();

        $nodeType = $model::create($attributes);

        $this->builderService->buildTable(
            $nodeType->getName(),
            $nodeType->getKey()
        );

        return $nodeType;
    }
548253
public function make(array $attributes = [])
    {
        $instance = $this->related->newInstance($attributes);
        $this->setForeignAttributesForCreate($instance);
        return $instance;
    }
17776
public static function fromArray(array $attributes)
    {
        return new self(
            $attributes['id'],
            $attributes['name'],
            $attributes['price'],
            $attributes['quantity'],
            Arr::get($attributes, 'options', [])
        );
    }
913620
public static function create(array $attributes = [])
    {
        return tap(self::make(call_user_func_array([static::$client, 'create'], func_get_args())), function ($model) {
            $model->exists = true;
        });
    }
132553
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;
	}
1246153
public function create(array $attributes = [])
    {
        // Create a new instance
        $instance = $this->createModel();

        // Fill instance with data
        $instance->fill($attributes);

        // Save the instance
        $created = $instance->save();

        // Fire the created event
        $this->getContainer('events')->fire($this->getRepositoryId().'.entity.created', [$this, $instance]);

        // Return instance
        return [
            $created,
            $instance,
        ];
    }
628301
public function computer(array $attributes = [])
    {
        $model = $this->schema->computerModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), [
                $this->schema->top(),
                $this->schema->person(),
                $this->schema->organizationalPerson(),
                $this->schema->user(),
                $this->schema->computer(),
            ]);
    }
569354
public function firstOrCreate(array $attributes = [])
    {
        $this->applyCriteria();
        $this->applyScope();

        $model = $this->model->firstOrCreate($attributes);
        $this->resetModel();

        return $this->parserResult($model);
    }
155968
public function create(array $attributes)
    {
        // Is this a bulk create?
        if (array_values($attributes) == $attributes) {
            $that = $this;
            $collection = new IlluminateCollection($attributes);
            return $collection->map(function($attrs) use ($that) { return $that->create($attrs); });
        }

        $model = $this->create_new($attributes);
        $model->save();

        // TODO: dry with 'queryEagerLoadRelations'
        $eagerLoads = $this->query->getEagerLoads();
        if (count($eagerLoads) > 0)
        {
            $relations = $this->query->eagerLoadRelations(array($model));
            $model = $relations[0];
        }

        return $model;
    }
533907
public function ou(array $attributes = [])
    {
        $model = $this->schema->organizationalUnitModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), [
                $this->schema->top(),
                $this->schema->organizationalUnit(),
            ]);
    }
93266
public function new(array $attributes = [], bool $exists = false): Model{
        return $this->model->newInstance($attributes, $exists);
    }
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);
    }
482896
public function row(array $attributes = array())
        {
            $row = new self();

            if (count($attributes)) {
                $row->setAttributes($attributes);
            }

            return $row;
        }