Laravel-permission: Array in @can

Created on 18 Jul 2017  路  2Comments  路  Source: spatie/laravel-permission

Hi,

Is there a way for @can like @hasanyrole(['callcenter', 'admin']) ?
I want to check if a user has 1 or more permissions like:
@can(['list companies', 'list users'])

Is there a workaround for this?

Raymond

Most helpful comment

@if(Auth::user()->hasAnyPermission(['list companies', 'list users'])

All 2 comments

@if(Auth::user()->hasAnyPermission(['list companies', 'list users'])

Thanks for answering this one @drbyte

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

vpratfr picture vpratfr  路  4Comments

tripex picture tripex  路  3Comments

wreighsantos picture wreighsantos  路  4Comments

ionesculiviucristian picture ionesculiviucristian  路  4Comments