fix: filter any 'no' RSVPs from the attendees
This commit is contained in:
parent
956945fd3f
commit
6a82fccecd
|
@ -10,11 +10,15 @@ use Tightenco\Collect\Support\Collection;
|
|||
final class FakeEventRepository implements EventRepository
|
||||
{
|
||||
public function getConfirmedAttendees(): Collection {
|
||||
return Collection::make([
|
||||
$rsvps = Collection::make([
|
||||
['name' => 'matthew s.', 'response' => 'yes'],
|
||||
['name' => 'Michael P.', 'response' => 'yes'],
|
||||
['name' => 'Kathryn "Kat" R.', 'response' => 'yes'],
|
||||
['name' => 'Did not attend', 'response' => 'no'],
|
||||
]);
|
||||
|
||||
return $rsvps
|
||||
->filter(fn (array $attendee): bool => $attendee['response'] == 'yes')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue