How to retrieve users without any assigned role?
You can leverage the Eloquent relations to find the users without the relationship by querying the count of those who "do" have the relationship, where the count is 0:
use \App\User;
use \Spatie\Permission\Models\Role;
$usersWithoutRoles = User::withCount('roles')->has('roles', 0)->get();
User::doesntHave('roles')->get();
Most helpful comment
User::doesntHave('roles')->get();