Beispiel #1
0
 /**
  * Get all of the pending invitations for the user.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function getPendingInvitationsForUser($user)
 {
     $invitations = $user->invitations()->with('team.owner')->get();
     foreach ($invitations as $invite) {
         $invite->setVisible(['id', 'team']);
         $invite->team->setVisible(['name', 'owner']);
         $invite->team->owner->setVisible(['name']);
     }
     return $invitations;
 }