check multiple permission laravel 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)
@elsecanany(['create'], \App\Models\Post::class)
@endcanany