-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Using blade templates this works:
@hasanyrole('admin|manager')
It works
@endhasanyroleUnfortunately this piece of code raises an error:
@hasanyrole(['admin', 'manager'])
This should work, too
@endhasanyroleThe error points to the line with @hasanyrole and says: ParseError syntax error, unexpected ']', expecting ')'
According to documentation at https://spatie.be/docs/laravel-permission/v5/basic-usage/blade-directives we should be able to pass $collectionOfRoles
PS. This works as well:
@if(auth()->user()->hasAnyRole(['admin', 'manager']))
This works as well
@endifVersions
- spatie/laravel-permission package version: 5.5.5
- laravel: 8.79.0
- PHP version: 7.4.19
- Database version: 10.6.4-MariaDB-log
Expected behavior
@hasanyrole should accept arrays
Metadata
Metadata
Assignees
Labels
No labels