Using session in MenuItem
Hi is there any possibility to use
session()
or auth()->getSession()
in MenuItem inside PanelProvider? Following code:
Produces error: Target class [hash] does not exist.
If I use session()
directly:
Then following error appears: Target class [cache] does not exist.
1 Reply
Those are service providers and the session doesn't exist yet. You need to wrap your code in a closure so it evaluated later.