insert([ // 'tipe_peti_id' => $this->getRandomId('type_petis'), // 'warna' => 'Warna', // 'fix_lot' => 'Dummy Fix Lot ' . ($i + 1), // 'packing_no' => rand(1, 100), // 'customer_id' => $this->getRandomId('customers'), // 'jumlah' => rand(1, 10), // 'date_pembuatan' => now(), // 'warehouse_id' => $this->getRandomId('m_warehouses'), // 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), // 'status' => 'AKTIF', // 'created_at' => now(), // 'updated_at' => now(), // 'created_by' => 'Seeder', // 'updated_by' => 'Seeder', // ]); // } DB::table('petis')->insert([ [ 'tipe_peti_id' => $this->getRandomId('type_petis'), 'warna' => 'Warna', 'fix_lot' => 'Dummy Fix Lot 1', 'packing_no' => 1, 'customer_id' => $this->getRandomId('customers'), 'jumlah' => 1, 'date_pembuatan' => now(), 'warehouse_id' => 1, 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'status' => 'AKTIF', 'created_at' => now(), 'updated_at' => now(), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ], [ 'tipe_peti_id' => $this->getRandomId('type_petis'), 'warna' => 'Warna', 'fix_lot' => 'Dummy Fix Lot 2', 'packing_no' => 2, 'customer_id' => $this->getRandomId('customers'), 'jumlah' => 2, 'date_pembuatan' => now(), 'warehouse_id' => 2, 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'status' => 'AKTIF', 'created_at' => now(), 'updated_at' => now(), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ], [ 'tipe_peti_id' => $this->getRandomId('type_petis'), 'warna' => 'Warna', 'fix_lot' => 'Dummy Fix Lot 3', 'packing_no' => 3, 'customer_id' => $this->getRandomId('customers'), 'jumlah' => 3, 'date_pembuatan' => now(), 'warehouse_id' => 3, 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'status' => 'AKTIF', 'created_at' => now(), 'updated_at' => now(), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ], [ 'tipe_peti_id' => $this->getRandomId('type_petis'), 'warna' => 'Warna', 'fix_lot' => 'Dummy Fix Lot 4', 'packing_no' => 4, 'customer_id' => $this->getRandomId('customers'), 'jumlah' => 4, 'date_pembuatan' => now(), 'warehouse_id' => 4, 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'status' => 'AKTIF', 'created_at' => now(), 'updated_at' => now(), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ], [ 'tipe_peti_id' => $this->getRandomId('type_petis'), 'warna' => 'Warna', 'fix_lot' => 'Dummy Fix Lot 5', 'packing_no' => 5, 'customer_id' => $this->getRandomId('customers'), 'jumlah' => 5, 'date_pembuatan' => now(), 'warehouse_id' => 1, 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'status' => 'AKTIF', 'created_at' => now(), 'updated_at' => now(), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ], ]); } /** * Get a random ID from a specific table * * @param string $tableName * @return string|null */ protected function getRandomId($table) { return DB::table($table)->inRandomOrder()->first()->id; } }