Remove the specified resource from storage.

@param \TypiCMS\Modules\Attributes\Shells\Models\Attribute $attribute

@return \Illuminate\Http\JsonResponse
3589
public function destroy(AttributeGroup $attribute)
    {
        $deleted = $this->repository->delete($attribute);

        return response()->json([
            'error' => !$deleted,
        ]);
    }
1251965
public function actionRemove($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(Url::to(['/shop/attribute']));
    }
896358
public function removeAttribute($attributeName)
	{
		if(array_key_exists($attributeName, $this->attributes) === false || in_array($attributeName, $this->lockedAttributes) === true)
			return;
		
		unset($this->attributes[$attributeName]);
	}
387932
public function allowAttribute($attribute)
    {
        if (is_array($attribute))
        {
            foreach ($attribute as $attrib)
                $this->allowed_attributes[$attrib] = true;
        }
        else
            $this->allowed_attributes[$attribute] = true;
        return $this;
    }
1229243
public function forgetAttribute($attribute)
    {
        if ($attribute === 'class') {
            $this->classes = [];

            return $this;
        }

        if (isset($this->attributes[$attribute])) {
            unset($this->attributes[$attribute]);
        }

        return $this;
    }
355714
protected function deleteModels($attribute)
    {
        $data = $this->relationalData[$attribute];

        /** @var ActiveRecord $model */
        foreach ($data['oldModels'] as $model) {
            if ($this->isDeletedModel($model, $attribute)) {
                if (!$model->delete()) {
                    Yii::$app->getDb()->getTransaction()->rollBack();
                    throw new RelationException('Model ' . $model::className() . ' not deleted due to unknown error');
                }
            }
        }

        $this->relationsMap($data['oldRows'], function($row) use ($attribute, $data) {
            if ($this->isDeletedRow($row, $attribute)) {
                Yii::$app->db->createCommand()
                    ->delete($data['junctionTable'], $row)
                    ->execute();
            }
        });
    }
396816
public function delete($table, $attribute)
    {
        $this->tableName = $table;

        if (is_array($attribute)) {
            return $this->trash($attribute, true);
        } elseif (is_string($attribute) || is_int($attribute)) {
            return $this->trash($attribute);
        }
    }
206747
function _removeAttr($attr, &$attributes)
    {
        $attr = strtolower($attr);
        if (isset($attributes[$attr])) {
            unset($attributes[$attr]);
        }
    }
964902
private function getAttributeId($attribute)
    {
        $attributeId = $attribute;

        if (is_object($attribute)) {
            $attributeId = $attribute->getAttributeId();
        }

        return $attributeId;
    }
133424
public function attr($attribute = null)
    {
        if ($this->isNull($attribute)) {
            return $this->attribute;
        }

        return $this->parent->attr($attribute);
    }
1066879
public function removeFilter($attribute)
    {
        assert(is_string($attribute));
        foreach ($this->_filters as $key => $filter) {
            if ($filter['attr'] == $attribute) {
                unset($this->_filters[$key]);

                return $this;
            }
        }

        return $this;
    }
463798
public boolean removeAttribute(String attribute, boolean removeFromACModel, boolean notifyListeners) {
                if (!super.removeObject(attribute, false)) {
                        return false;
                }

                if (acModel != null && removeFromACModel && acModel.getContext() != this) {
                        acModel.getContext().removeObject(attribute);
                }

                // Remove data usage of removed attributes
                for (String activity : activities) {
                        removeDataUsageFor(activity, attribute);
                }
                if (notifyListeners) {
                        contextListenerSupport.notifyObjectRemoved(attribute);
                }
                return true;
        }
1159139
public function removeAttribute($key) {
        if (is_array($key)) {
            foreach ($key as $k => $value) {
                if (!is_string($value)) throw new IllegalTypeException('Illegal type of parameter $key['.$k.']: '.gettype($value));
                unset($_SESSION[$value]);
            }
            return;
        }

        if (!is_string($key)) throw new IllegalTypeException('Illegal type of parameter $key: '.gettype($key));
        unset($_SESSION[$key]);
    }
214758
public function emptyValues(AttributeInterface $attribute = null, array $context = null)
    {
        $values = $this->getInternalValues($attribute, $context);
        foreach ($values as $value) {
            $this->removeValue($value);
        }

        return $this;
    }
627791
protected function emptyAttribute($object, $attribute)
	{
		if($this->safe) 
			$object->$attribute=null;

		if(!$this->allowEmpty)
		{
			$message=$this->message!==null?$this->message : Yii::t('yii','{attribute} cannot be blank.');
			$this->addError($object,$attribute,$message);
		}
	}
1135631
public function update(Attribute $attribute, array $data)
    {
        if (Session::has('multi_language_enabled')) {
            $languageId = $data['language_id'];
            $languaModel = Language::find($languageId);
            
            if ($languaModel->is_default) {
                return $attribute->update($data);
            } else {
                
                $translatedModel = $attribute
                    ->translations()
                    ->whereLanguageId($languageId)
                    ->first();
                if (null === $translatedModel) {
                    return AttributeTranslation::create(
                        array_merge($data, ['attribute_id' => $attribute->id])
                    );
                } else {
                    $translatedModel->update(
                        $data,
                        $attribute->getTranslatedAttributes()
                    );

                    return $translatedModel;
                }
            }
        } else {
            return $attribute->update($data);
        }
    }
352617
protected function replaceAttribute($attribute)
	{
		if (array_key_exists($attribute, $this->replacements)) {
			return $this->replacements[$attribute];
		}

		return $attribute;
	}