Using session in MenuItem

Hi is there any possibility to use session() or auth()->getSession() in MenuItem inside PanelProvider? Following code:

            ->userMenuItems([
                'session' => MenuItem::make()
                    ->label(auth()->getSession()->get('value')),
            ])


Produces error: Target class [hash] does not exist.

If I use session() directly:

            ->userMenuItems([
                'session' => MenuItem::make()
                    ->label(session('value')),
            ])


Then following error appears: Target class [cache] does not exist.
Was this page helpful?