save(); $this->createVacationLimitsFor($user); return $user; } protected function createVacationLimitsFor(User $user): void { $yearPeriods = YearPeriod::all(); foreach ($yearPeriods as $yearPeriod) { $user->vacationLimits()->create([ "year_period_id" => $yearPeriod->id, ]); } } }