Reputation: 1
Can you guys help me? I just want to know how to check if the user do not have a permission from an array of permission on laravel blade. I think is the inverse of @canany
Maybe the illustration in my head is like this :
if( !($user->canany(['store', 'update'])) ) {
// user don't have store or update permission
}
For now my code is like :
@canany($permissions)
// user have the permission, but i don't need this section
@else
// user don't have the permission, but i need this section
@endcanany
Because of that, I want my to code in my blade file is like :
@inverseCanAny($permissions)
// do something when user don't have the permissions
@endInverseCanAny
Sorry if my English is bad
Thank you!
Upvotes: -1
Views: 355
Reputation: 92
try @cannot
this references may help you
or just let it empty and only fill the else condition
Upvotes: 0