*/ class OrderFactory extends Factory { /** * @return array */ public function definition(): array { return [ 'store_id' => Store::factory(), 'public_id' => fn () => (string) Str::ulid(), 'number' => fake()->unique()->numberBetween(1001, 999999), 'status' => OrderStatus::Pending, 'customer_name' => 'Aminah binti Ali', 'customer_email' => 'aminah@example.com', 'customer_phone' => '0123456789', 'shipping_address' => [ 'line1' => '12 Jalan Mawar', 'line2' => null, 'city' => 'Shah Alam', 'postcode' => '40000', 'state' => 'Selangor', 'country' => 'MY', ], 'subtotal' => 2580, 'shipping_total' => 0, 'total' => 2580, 'currency' => 'MYR', ]; } public function paid(): static { return $this->state(['status' => OrderStatus::Paid, 'paid_at' => now(), 'payment_reference' => 'pi_test']); } }