permission multiple create spatie code example

Example: check multiple permission laravel spatie

You can check if a user has Any of an array of permissions:
$user->hasAnyPermission(['edit articles', 'publish articles', 'unpublish articles']);

If you need to check that the model has all the permissions, you should use 
method hasAllPermissions()
$user->hasAllPermissions('View Consultant', 'View Administration', 'View Accountant', 'All departments')
  
or try something like this :

@canany(['update', 'view', 'delete'], $post)
    <!-- The current user can update, view, or delete the post... -->
@elsecanany(['create'], \App\Models\Post::class)
    <!-- The current user can create a post... -->
@endcanany

Tags:

Php Example