$cat]); } foreach(['Roti Tawar', 'Indomie', 'Telur Omega 3'] as $prod) { Product::create([ 'code' => Str::upper(Str::random(6)), 'name' => $prod, 'price' => rand(1000,10000), 'cost' => rand(1000,10000), 'stock' => rand(1,99), 'category_id' => $category->id, ]); } foreach (['Customer A', 'Customer B'] as $cust) { Customer::create([ 'code' => Str::upper(Str::random(6)), 'name' => $cust, ]); } } }