public function getAttribute($key) { if ($this->data->has($key)) { return $this->data->get($key); } }