dynamic navigation item in panel
Hey there,
i tried to create a dynamic navigation items:
The error came up and I don't know where to add the Hash-Class? Can someone help me out?
Thank you 🙂
Solution:Jump to solution
found a workaround to hide the group as well, if the user cannot access the panel:
```php
public function panel(Panel $panel): Panel
{...
8 Replies
just for clarify: I didn't use visible or hidden on NavigationItem, because the group will still be shown even if there is no menu item in it.
Can you click the SHARE button at the top of the error page and paste the link?
Thanks! I'm not entirely sure but I think this could be too early in the Laravel "lifecycle" to access the user instance.
Something to try:
unfortunately now auth()->user is null 😄
https://flareapp.io/share/VP6MO6Rm
Flare
Call to a member function canAccessPanel() on null - The error occurred at https://timetracker.test/company
Solution
found a workaround to hide the group as well, if the user cannot access the panel:
This is working right now and I think I can live with that 🙂
thank you very much @Patrick Boivin 👌
Nice solution!