public function getSessionAttribute(string $name, $default = null) { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->get($name, $default); } return $default; }