Level 3
@fareedr You may try these steps.
- First make sure, API guard present in your
Usermodel.
class User extends Authenticatable
{
use Notifiable, HasRoles;
/**
* Default guard name for roles.
*
* @var string
*/
protected $guard_name = 'api';
}
- There is a caching system of role, permission in this package. So clear you cache.
php artisan permission:cache-reset
// or
php artisan cache:clear
- Get user by role
$admins = User::role('admin')->get();
Let us know your feedback.