Create a post.

@param  array  $attributes

@return self
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)
            );
        });
    }
538652
public function attributes(array $attributes)
        {
            $this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));

            return $this;
        }
611821
public function add(array $attributes)
    {
        foreach ($attributes as $key => $values) {
            $this->set($key, $values);
        }

        return $this;
    }
1072925
public function withAttributes(array $attributes = []): Element
    {
        $this->attributes = array_merge(
            $this->attributes,
            $attributes
        );

        return $this;
    }
104739
public function refresh(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            if ($this->has($attribute)) {
                $this->attributes[$this->resolveAttributeName($attribute)] = $value;
            } else {
                $this->attributes[$attribute] = $value;
            }
        }

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

        return static::create($attributes);
    }
739165
public function createInput(array $attributes = [])
    {
        $field = new Components\Form\Elements\Input();

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $field->attributes->addAttribute($name, $value);

                if ($name === 'name') {
                    $this->entity->setEntityName('input-' . $value);

                    if ( ! array_key_exists('id', $attributes)) {
                        $field->attributes->setAttributeId('input-' . $value);
                    }
                }
            }
        }

        $this->childNodes->push($field);

        return $this->childNodes->last();
    }
22764
public function create( array $attributes = [] )
	{
		$results = $this->make( $attributes );

		if ( $this->amount === 1 )
			$results->save();
		else
			foreach ( $results as $result )
				$result->save();

		return $results;
	}
1324443
public function mergeWith(self $attributes)
    {
        $this->attributes = array_merge($this->attributes, $attributes->attributes);
        $this->classes = array_merge($this->classes, $attributes->classes);

        return $this;
    }
1092179
public function attributes($attributes)
    {
        if (is_array($this->attributes) and is_array($attributes)) {
            $attributes = array_merge($this->attributes, $attributes);
        }
        $this->attributes = $attributes;

        return $this;
    }
491708
public static function init(array $attributes) {
        $obj = new Attributes;
        foreach ($attributes as $attribute) {
            $obj->{$attribute->key} = $attribute;
        }
        return $obj;
    }
1251588
public static function createOne(array $attributes)
    {
        return tap(new static, function (self $taxonomy) use ($attributes) {
            $attributes['slug'] = $attributes['slug'] ?? $attributes['name'];

            $taxonomy->populate($attributes)->save();
        });
    }
198571
public function create_new(array $attributes = array())
    {
        $instance = null;

        if (!$this->is_collection) {
            $instance = new self::$custom_collections[$this->name]();
        } else {
            $instance = new Collection(array('table_name' => $this->name));
        }

        $instance->fill($attributes);

        // Fill '_id' if it's provided and in a trusted context
        if (isset($attributes['_id']) && Context::isTrusted()) {
            $instance->_id = $attributes['_id'];
        }

        return $instance;
    }
621878
public static function factory($attributes)
    {
        $instance = new self();
        $values = array_values($attributes);
        $instance->_initialize(array_shift($values));
        return $instance;
    }
1259588
public function addAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
845151
public function fill( array $attributes ) {
		foreach ( $attributes as $key => $value ) {
			if ( ! array_key_exists( $key, $this->attributes ) ) {
				continue;
			}

			$this->set_attribute( $key, $value );
		}

		return $this;
	}
773229
public static function create(array $attributes = [])
    {
        $className = get_called_class();
        /** @var ModelInterface $model */
        $model = new $className($attributes);
        $model->setIsNewRecord(false);

        return $model;
    }