i'm using entrust package Basically I just want to count users based on roles something like this:
$users = User::whereHas('roles')->count();
dd($users);
naturally what i'm getting is the count of users with roles, but what i'm trying to get is something like this..
expected
**roles count**
admin 4
user 2
$role_name $User_withthisRole_count
Edited: i want something dynamic, i don't want to add roles manually
not sure what to do..