password = Hash::make(Str::random(40)); } public function created(User $user): void { $yearPeriods = YearPeriod::all(); foreach ($yearPeriods as $yearPeriod) { $user->vacationLimits()->create([ "year_period_id" => $yearPeriod->id, ]); } } }