spatie roles laravel code example
Example 1: get users of specific role laravel role spatie
$users = User::role('writer')->get();
Example 2: laravel roles and permissions
composer require spatie/laravel-permission
$users = User::role('writer')->get();
composer require spatie/laravel-permission