ACL Laravel using ADMINLTE

Good Morning.

I'm using laravel 5.5 and adminlte. I implemented the acl with middlewares and use can to test the permissions. I would like to put the can ('centrocusto') in the adminLte menu. It's not working. Has anyone ever done this? You know how it's done? Example: @ can [ 'text' = > 'cost center', 'icon' = > 'file', 'url' = > 'admin / centrocusto', ], @ endcan Thanks.

Author: Marcos Birro, 2018-11-15

1 answers

AdminLTE has the option can if you want to conditionally display the menu item, it integrates with Laravel's Gate functionality, and is defined directly in the array, like this:

[ 
    'text' => 'Centro de Custo', 
    'icon' => 'file', 
    'url' => 'admin/centrocusto', 
    'can' => 'centrocusto'
]

Reference

 1
Author: Dobrychtop, 2018-11-22 18:03:31