/**
* Get the attribute
*
* @param string $key An attributes key
* @param string $default A default value
*
* @return mixed
*
* @since 4.0.0
*/
public function getAttribute(string $key, $default = null)
{
if (array_key_exists($key, $this->attributes)) {
return $this->attributes[$key];
}
return $default;
}