add('people', fn (User $user, ?CarbonImmutable $before, int $limit) => User::query() ->active() ->whereKeyNot($user->getKey()) ->where('created_at', '>=', now()->subDays(120)) ->when($before, fn ($query) => $query->where('created_at', '<', $before)) ->latest() ->limit($limit) ->get() ->map(fn (User $person) => [ 'id' => 'person-'.$person->id, 'kind' => 'welcome', 'time' => $person->created_at, 'actor' => Feed::person($person), 'badge' => 'Neu im Team', 'title' => $person->name.' ist neu im Team', 'text' => implode(' · ', array_filter([$person->job_title, $person->department, $person->location])), 'url' => route('people.show', $person), 'cta' => ['label' => 'Profil ansehen', 'url' => route('people.show', $person)], ])); } }