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

@param  array  $attributes
@return \Globalis\PuppetSkilled\Database\Magic\Model
189228
public function make(array $attributes = [])
    {
        $instance = $this->related->newInstance($attributes);
        $instance->setAttribute($this->getForeignKeyName(), $this->getParentKey());
        return $instance;
    }
231079
public function withAttributes(array $attributes): self
    {
        $result = clone $this;
        $result->attributes = new ParameterCollection($attributes);

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

        return (new $model($attributes, $this->query));
    }
1258966
public static function firstOrCreate(array $attributes)
    {
        if (! is_null($instance = static::where($attributes)->first())) {
            return $instance;
        }

        return static::create($attributes);
    }
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(),
            ]);
    }
1297832
public function make(array $attributes = [])
    {
        if ($this->amount === null) {
            return $this->makeInstance($attributes);
        } else {
            $results = [];

            for ($i = 0; $i < $this->amount; $i++) {
                $results[] = $this->makeInstance($attributes);
            }
            
            return new Collection($results);
        }
    }
788330
public static function make($attributes = [])
    {
        $jobset = new static();

        // make jobset model
        $model = $jobset->makeModel($attributes);
        // update local model
        $jobset->setModel($model);
        // make job models and init job instances
        $jobset->makeJobs();
        // set jobset try at
        $jobsetTryAt = $jobset->getJobsEarliestTryAt();
        $jobset->model->setTryAt($jobsetTryAt);
        $jobset->model->persist();

        return $jobset;
    }
1122365
public function firstOrCreate(array $attributes = [])
    {
        $model = $this->first();
        if (!$model) {
            $model = $this->create($attributes);
        }
        return $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;
    }
1009243
public function create(array $attributes)
	{
		$group = $this->createModel();
		$group->fill($attributes);
		$group->save();
		return $group;
	}
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();
        });
    }
1096913
public function createElement(array $attributes)
    {
        $element = $this->ownerDocument->createElement($this->element);

        $name = null;
        foreach ($attributes as $key => $value) {
            $element->setAttribute($key, $value);
        }

        $this[] = $element;

        return $element;
    }
17776
public static function fromArray(array $attributes)
    {
        return new self(
            $attributes['id'],
            $attributes['name'],
            $attributes['price'],
            $attributes['quantity'],
            Arr::get($attributes, 'options', [])
        );
    }
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;
        }
    }
848274
public function withAttributes(array $attributes)
    {
        $clone = clone $this;

        foreach ($attributes as $name => $value) {
            $clone->dom->documentElement->setAttribute($name, $value);
        }

        return $clone;
    }
701122
public function store(array $attributes)
    {
        $model = $this->make([]);

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

        $this->fillModel($model, $attributes);
        $this->fire($this->event('storing'), [$model, $attributes]);
        $model->save();
        $this->fire($this->event('stored'), [$model, $attributes]);
        return $model;
    }
523882
private function toElequent(array $attributes)
    {
        $obj = new static();
        $casts = $obj->casts;
        $obj->casts = [];
        $obj->setRawAttributes($attributes);
        $obj->casts = $casts;

        return $obj;
    }