cache !== null) { return $this->cache['user']; } $user = Auth::user(); $user?->loadMissing(['avatar', 'profile']); $this->cache['user'] = $user; return $this->cache['user']; } public function refresh(): void { $this->cache = null; } }