talkRepository = $talkRepository; } public function getCount(): int { $today = Carbon::today()->format('Y-m-d H:i:s'); return $this->talkRepository ->findAllPublished() ->flatMap(fn(Talk $talk) => $talk->getEvents()) ->filter(fn(ParagraphInterface $event) => $event->get('field_date')->getString() <= $today) ->count(); } }