public function removeAttributeValue(string $attribute, string $value): self
    {
        // Only remove value if attribute is present
        if (! array_key_exists($attribute, $this->attributes)) {
            return $this;
        }

        // Remove the value from the attribute
        $values = array_filter(
            $this->getAttribute($attribute),
            function ($attributeValue) use ($value) {
                return $attributeValue !== $value;
            }
        );

        // Stores the new values
        $this->setAttribute($attribute, $values);

        return $this;
    }
public function removeAttributeValue(string $attribute, string $value): self
    {
        // Only remove value if attribute is present
        if (! array_key_exists($attribute, $this->attributes)) {
            return $this;
        }

        // Remove the value from the attribute
        $values = array_filter(
            $this->getAttribute($attribute),
            function ($attributeValue) use ($value) {
                return $attributeValue !== $value;
            }
        );

        // Stores the new values
        $this->setAttribute($attribute, $values);

        return $this;
    }
public function removeAttributeValue ( string $ attribute , string $ value ) : self { // Only remove value if attribute is present if ( ! array_key_exists ( $ attribute , $ this -> attributes ) ) { return $ this ; } // Remove the value from the attribute $ values = array_filter ( $ this -> getAttribute ( $ attribute ) , function ( $ attributeValue ) use ( $ value ) { return $ attributeValue !== $ value ; } ) ; // Stores the new values $ this -> setAttribute ( $ attribute , $ values ) ; return $ this ; }
Removes a value from the attribute.
@param string $attribute
@param string $value
@return $this
Removes a value from the attribute .