*/ class OrderWithdrawalFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'shopping_order_id' => null, 'user_shop_id' => null, 'type' => OrderWithdrawal::TYPE_FULL, 'status' => OrderWithdrawal::STATUS_RECEIVED, 'order_reference' => (string) $this->faker->numberBetween(1000, 99999), 'customer_email' => $this->faker->safeEmail(), 'customer_name' => $this->faker->name(), 'reason' => $this->faker->optional()->sentence(), 'items' => null, 'ip_address' => $this->faker->ipv4(), 'user_agent' => $this->faker->userAgent(), 'declared_at' => now(), ]; } public function partial(): self { return $this->state(fn (): array => ['type' => OrderWithdrawal::TYPE_PARTIAL]); } }