randomFloat(4, 0.5, 100); $unitPrice = fake()->numberBetween(1000, 100000); return [ 'purchase_id' => Purchase::factory(), 'user_id' => User::factory(), 'raw_material_price_id' => RawMaterialPrice::factory(), 'quantity' => $quantity, 'unit_price' => $unitPrice, 'subtotal' => (int) ($quantity * $unitPrice), ]; } }