I created a sub menu that hides the options of the submenu if I do not have the permission, but it leaves me the name of the menu, I do not know if you understand. I attach images.
User with permission has access to see the Management Report menu. ??
User without permission should NOT have access to see the Management Report menu.
This is the code
->submenu(
SpatieMenuLink::to('#','<i class="ri-folder-chart-line"></i><span>Reportes Gerenciales</span><i
class="ri-arrow-right-s-line iq-arrow-right"></i>')
->addClass('iq-waves-effect'),
Menu::new()
->addClass('iq-submenu')
->routeIfCan('view all reports', 'home.salesManager', 'Desempe?o de leads')
->routeIfCan('view all reports', 'home.historicalReports', 'Historico de ejecutivo')
)
question from:
https://stackoverflow.com/questions/65847718/how-to-hide-a-whole-menu-with-its-submenu-if-you-do-not-have-the-permission-spa 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…