I'm trying to figure out if there is a simple way to get all the users that have a role or another role.
On the official documentation of Spatie Laravel Permissions, I couldn't find this.
I'm trying like this but I get all the users.
User::role(['Individual', 'Organisation', 'Venue'])->get();
I'm also trying like this:
User::whereHas("roles", function($q) {
$q->orWhere(function ($query) {
$query->where("name", "Individual")
->where("name", "Venue")
->where("name", "Organisation");
});
})->get();
In the Db roles table I have: