Vra

What is the best way to get the Sentry Groups my USER model belongs to in Laravel 4.1?

I couldn't find anything in the docs about this.

Was dit nuttig?

Oplossing

The Sentry docs are pretty bare bones. You can do this to get the groups belonging to a user:

$user = User::findOrFail($id);

$user->getGroups();

foreach($user->groups as $group)
{
     echo $group->name;
}

Ander wenke

According to the sentry docs perform the getGroups() Method on the user.

Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow
scroll top