ACL Laravel using ADMINLTE

Asked

Viewed 277 times

1

Good morning.

I am using Laravel 5.5 and adminlte. I implemented Acl with middlewares and use can to test permissions. I would like to put can('centrocusto') in the adminLte menu. It’s not working. Has anyone ever done this? Do you know how to do it? Example: @can [ 'text' => 'Cost Center', 'icon' => 'file', 'url' => 'admin/centrocusto', ], @endcan Thank you.

1 answer

1

The Administration 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, thus:

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

Reference

Browser other questions tagged

You are not signed in. Login or sign up in order to post.