Install an extension.

@param string $type
@param array $attributes
@return \Yajra\CMS\Entities\Extension
482338
public function install($type, array $attributes)
    {
        $extension       = new Extension;
        $extension->type = $type;
        $extension->name = $attributes['name'];
        if (isset($attributes['parameters'])) {
            $extension->parameters = $attributes['parameters'];
        }
        $extension->manifest = json_encode($attributes);
        $extension->save();

        return $extension;
    }
622108
public function add($attribute, ...$values)
    {
        foreach ($values as $value) {
            if ($this->has($attribute)) {
                $attribute = $this->resolveAttributeName($attribute);
                $this->attributes[$attribute] = $this->addAttributeValue($this->attributes[$attribute], $value);
            } else {
                $this->attributes[$attribute] = $value;
            }
            $this->batches->add(new Batch(Batch::TYPE['ADD'], $attribute, $value));
        }

        return $this;
    }
336285
public static function insertIgnore(array $attributes = [])
    {
        $model = new static();
        $driver = $model->GetConnection()->GetDriverName();
        switch ($driver) {
            case 'sqlite':
                return static::executeQuery('insert or ignore', $attributes);
                break;
            default:
                return static::executeQuery('insert ignore', $attributes);
                break;
        }
    }
65982
public function setAttributes(array $attributes = [])
    {
        $this->attributes = array_merge($this->attributes, $attributes);

        $this->validateAttributes();

        $this->decoupleOptionsFromAttributes();

        return $this;
    }
1327791
public static function script($src, $type = 'text/javascript', array $attributes = array())
    {
        $attributes = array_merge($attributes, compact('src', 'type'));

        return '<script' . self::attributes($attributes) . '></script>' . PHP_EOL;
    }
1133756
public function setAttributes($attributes)
    {
        foreach ($attributes as $attribute => $value) {
            if ($attribute === 'class') {
                $this->addClass($value);
                continue;
            }

            if (is_int($attribute)) {
                $attribute = $value;
                $value = '';
            }

            $this->setAttribute($attribute, (string) $value);
        }

        return $this;
    }
1352513
public function setAttributes(array $attributes)
    {
        $this->attributes = [];
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
65404
public function createField($column, $attributes, $type = 'add')
    {
        $results = "\t\t\t" . '$table';
        foreach ($attributes as $key => $field) {
            $results .= $this->{"{$type}Column"}($key, $field, $column);
        }

        return $results .= ';' . PHP_EOL;
    }
182554
public function addField(array $attributes)
    {
        $field = $this->fields()->create($attributes);

        $this->save();

        return $field;
    }
152804
public function addColumn($name, $type, array $attributes = [])
    {
        if ($this->scope == 'alter') {
            $command = 'ADD COLUMN';
        } else {
            $command = null;
        }

        $this->sqls[] = $this->composeAddColumn(
            trim($name, '`'),
            compact('name', 'type', 'attributes', 'command')
        );

        return $this;
    }
623679
protected function createAndFill(array $attributes)
    {
        $entityClass = static::makes();
        $entity = new $entityClass;

        foreach($attributes as $attribute => $value) {
            $entity->$attribute = $value;
        }

        return $entity;
    }
299160
public function addTypeExtension($type, $extension, $priority = 0)
    {
        if ($extension instanceof ExtensionInterface) {
            $this->extensionRegistry->addExtension($extension);
            $this->typeExtension[$type][$priority][get_class($extension)] = true;
        } elseif (is_string($extension)) {
            $this->typeExtension[$type][$priority][$extension] = true;
        }

        return $this;
    }
103220
public function addField($name, array $attributes)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $this->fields[$name] = $attributes;
        return $this;
    }
1372831
public static function script($text, array $attributes = [], $type = 'text/javascript')
    {
        return static::openTag('script',
            array_merge($attributes, ['type' => $type])).
            ' /*<![CDATA[*/ '.$text.' /*]]>*/ '.
            static::closeTag('script');
    }
763148
protected function setProperties(
        $type = null,
        $key = null,
        $attributes = [],
        $validKeys = []
    ) {
        if (isset($this->properties['type']) && $this->properties['type'] == $type) {
            foreach ($attributes as $attribute => $value) {
                if (in_array($attribute, $validKeys)) {
                    $this->{$key}[$attribute] = $value;
                }
            }
        }
    }
653230
public function add(array $attributes = array())
    {
        if (!$this->contains($attributes)) {
            $this->model->getModel()->newInstance($attributes)->save();
            $this->cache->forget($this->cacheKey);
        }
        return $this;
    }
573346
public function addAttribute($key, $value, $type = Attribute::T_DEFAULT){
		$this->attributes[] = new Attribute($key, $value, $type);
		return $this;
	}