yearPeriod->vacationRequests()->count(); $number = $count + 1; $vacationRequest->name = "{$number}/{$vacationRequest->yearPeriod->year}"; } }