mpociot / teamwork

User to Team associations with invitation system for the Laravel 5 Framework
MIT License
1.07k stars 170 forks source link

How to list teams and members of other users? #148

Closed hondaman900 closed 1 year ago

hondaman900 commented 2 years ago

I can use the methods with Auth::user, and the examples given all pertain to current authenticated user, and return the correct results. However, I need to be able to list the teams and teams members for other users that are not the current user.

For instance I can do the following:

Auth::user()->currentTeam

But not this:

$testuser = User::where('id',140)->get();
        $testuser->currentTeam;

Which gives "Exception, Property [currentTeam] does not exist on this collection instance."

What is it that prevents me from applying the methods to other user data and/or are there methods available to do this that I'm not aware of?

Thanks in advance for the help.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

hondaman900 commented 10 months ago

My original question has not been answered and I again need to determine how to list the teams of a given user (not the currently logged in user), and how to list members of a given team (not the current user's team). Is there a way to access this information on other users? I need this to provide admin oversight for admin roles.

I'm hoping someone has an answer to this question before the bot closes it down again due to inactivity.