문제

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.

도움이 되었습니까?

해결책

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;
}

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top