public function getAttribute($attributes, $name) {
        foreach($attributes as $a) {
            if ($a->key == $name) {
                return $a->value;
            }
        }
        return null;
    }
public function getAttribute($attributes, $name) {
        foreach($attributes as $a) {
            if ($a->key == $name) {
                return $a->value;
            }
        }
        return null;
    }
public function getAttribute ( $ attributes , $ name ) { foreach ( $ attributes as $ a ) { if ( $ a -> key == $ name ) { return $ a -> value ; } } return null ; }
Returns the value of attribute with name

@param $attributes array of attributes
@param $name string Attribute's name
@return mixed Attribute value
Returns the value of attribute with name