public function hasSessionAttribute(string $name) : bool { if (null !== $this->getCurrentRequest() && $this->request->hasSession()) { return $this->request->getSession()->has($name); } return false; }