[$name, $email, $phone, $childName, $gender, $ageMonths, $weight, $height, $zBbu, $zTbu, $zBbtb, $status]) { $parent = User::query()->updateOrCreate( ['phone' => $phone], [ 'name' => $name, 'email' => $email, 'role' => 'orang_tua', 'account_status' => 'Aktif', 'parent_gender' => $index % 2 === 0 ? 'ayah' : 'bunda', 'password' => Hash::make('password123'), 'last_active_at' => now()->subHours($index + 1), ], ); $child = Child::query()->updateOrCreate( ['user_id' => $parent->id, 'nama' => $childName], [ 'nama_anak' => $childName, 'tanggal_lahir' => now()->subMonths($ageMonths)->toDateString(), 'jenis_kelamin' => $gender, ], ); Measurement::query()->updateOrCreate( ['child_id' => $child->id, 'tanggal_ukur' => now()->subDays($index % 7)->toDateString()], [ 'berat' => $weight, 'tinggi' => $height, 'cara_ukur' => 'standing', 'umur_bulan' => $ageMonths, 'z_bbu' => $zBbu, 'z_tbu' => $zTbu, 'z_bbtb' => $zBbtb, 'kategori' => [ 'BB/U' => $zBbu, 'TB/U' => $zTbu, 'BB/TB' => $zBbtb, ], 'status_gabungan' => $status, 'created_at' => now()->subHours($index + 1), ], ); } } }