*/ public function query(): Builder { return Member::with('memberships', fn ($q) => $q->isTrying()) ->whereHas('memberships', fn ($q) => $q->isTrying()); } /** * @return array{members: array} */ public function data(): array { return [ 'members' => $this->query()->get()->map(fn ($member) => [ 'name' => $member->fullname, 'try_ends_at' => $member->memberships->first()->from->addWeeks(8)->format('d.m.Y'), 'try_ends_at_human' => $member->memberships->first()->from->addWeeks(8)->diffForHumans(), ])->toArray(), ]; } public function component(): string { return 'testers'; } public function title(): string { return 'Endende Schhnupperzeiten'; } }