laravel spatie permissions how to assign role to user code example
Example 1: laravel roles and permissions
composer require spatie/laravel-permission
Example 2: get users by role name - spatie/laravel-permission
User::whereHas("roles", function($q){ $q->where("name", "Member"); })->get()