public function getAttribute($attribute, $default = null) { if (!array_key_exists($attribute, $this->attributes)) { return $default; } return $this->attributes[$attribute]; }