ACL Laravel using ADMINLTE

0

Good morning.

I'm using laravel 5.5 and adminlte. I implemented acl with middleware and I use can to test the permissions. I would like to put the can ('centrocusto') in the adminLte menu. Is not working. Has anyone done this? Do you know how to do it? Example:                 @can                 [                     'text' = > 'Cost center',                     'icon' = > 'filet',                     'url' = > 'admin / centrocusto',                 ],                 @endcan Thank you.

    
asked by anonymous 15.11.2018 / 12:33

1 answer

1

AdminLTE has the can option 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

    
22.11.2018 / 19:03