setColor("#527aba") ->setItems($this->mapVacationRequests($vacationRequests)); } protected function mapVacationRequests(Collection $vacationRequests): Collection { return $vacationRequests->map(function (VacationRequest $request): string { $url = route("vacation.requests.show", ["vacationRequest" => $request->id]); $date = $request->from->equalTo($request->to) ? "{$request->from->toDisplayString()}" : "{$request->from->toDisplayString()} - {$request->to->toDisplayString()}"; return __("<:url|Request no. :request> for user :user (:date)",["url"=> $url, "request"=>$request->name,"user"=>$request->profile->full_name,"date"=>$date]); }); } }