1 | <?php |
||
9 | class Teamwork |
||
10 | { |
||
11 | /** |
||
12 | * Laravel application. |
||
13 | * |
||
14 | * @var \Illuminate\Foundation\Application |
||
15 | */ |
||
16 | public $app; |
||
17 | |||
18 | /** |
||
19 | * Create a new Teamwork instance. |
||
20 | * |
||
21 | * @param \Illuminate\Foundation\Application $app |
||
22 | */ |
||
23 | public function __construct(Application $app) |
||
27 | |||
28 | /** |
||
29 | * Get the currently authenticated user or null. |
||
30 | */ |
||
31 | public function user() |
||
35 | |||
36 | /** |
||
37 | * Invite an email adress to a team. |
||
38 | * Either provide a email address or an object with an email property. |
||
39 | * |
||
40 | * If no team is given, the current_team_id will be used instead. |
||
41 | * |
||
42 | * @param string|User $user |
||
43 | * @param null|Team $team |
||
44 | * @param callable $success |
||
45 | * @return TeamInvite |
||
46 | * @throws \Exception |
||
47 | */ |
||
48 | public function inviteToTeam($user, $team = null, callable $success = null) |
||
82 | |||
83 | /** |
||
84 | * Checks if the given email address has a pending invite for the |
||
85 | * provided Team. |
||
86 | * @param $email |
||
87 | * @param Team|array|int $team |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function hasPendingInvite($email, $team) |
||
101 | |||
102 | /** |
||
103 | * @param $token |
||
104 | * @return mixed |
||
105 | */ |
||
106 | public function getInviteFromAcceptToken($token) |
||
110 | |||
111 | /** |
||
112 | * @param TeamInvite $invite |
||
113 | */ |
||
114 | public function acceptInvite(TeamInvite $invite) |
||
119 | |||
120 | /** |
||
121 | * @param $token |
||
122 | * @return mixed |
||
123 | */ |
||
124 | public function getInviteFromDenyToken($token) |
||
128 | |||
129 | /** |
||
130 | * @param TeamInvite $invite |
||
131 | */ |
||
132 | public function denyInvite(TeamInvite $invite) |
||
136 | } |
||
137 |