public function getAttribute($name) { if ($this->hasAttribute($name)) { return $this->attributes[$name]; } else { return null; } }