get permissions for roles laravel code example
Example 1: laravel permission
//install laravel permission with composer installer for Laravel 6.0 or higher
composer require spatie/laravel-permission
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
Example 2: get users by role name - spatie/laravel-permission
User::whereHas("roles", function($q){ $q->where("name", "Member"); })->get()