name = $response['descriptor']; $group->id = $response['id']; return $group; } public function toArray() { return [ 'id' => $this->id, 'name' => $this->name ]; } public function subgroups() { return Nami::subgroupsOf($this->id); } public function members(): MemberCollection { return new MemberCollection(Nami::membersOf($this->id)->map(function($member) { return $this->member($member['id']); })); } public function member($id): Member { return Member::fromNami(Nami::member($this->id, $id)); } }