Exemplo n.º 1
0
 /**
  * @param Entry $entry
  * @return Collection
  */
 public function getUserListForEntry(Entry $entry)
 {
     $list = collect([]);
     $list->push($entry->owner);
     $list->push($entry->project->owner);
     foreach ($entry->shares as $share) {
         $list->push($share->user);
     }
     foreach ($entry->teamShares()->with('team', 'team.users')->get() as $share) {
         $list->push($share->team->owner);
         $list = $list->merge($share->team->users);
     }
     foreach ($entry->project->teams()->with('users')->get() as $team) {
         $list->push($team->owner);
         $list = $list->merge($team->users);
     }
     return $list->unique('id');
 }