-1

I use laratrust as my user role, in the user role there are 1 = superadministrator, 2 = administrator, 3 = perusahaan, then I want to display the names of existing perusahaan in my view, which means calling user = role id 3, then how to call it? I also don't really understand eloquent relationships

aldi N
  • 1

1 Answers1

0

You need to get users in this way

// This will return the users with 'superadministrator' role.
$users = User::whereRoleIs('superadministrator')->get();

check the documentation