Returns an attribute by name.
string $name The attribute name:
mixed $default Default value is the attribute doesn't exist:
mixed The attribute value
public function getAttribute($name, $default = null) {
return $this
->hasAttribute($name) ? $this->attributes[$name] : $default;
}