Order::factory(), 'address_type' => 'shipping', 'orderer_name' => $faker->name(), 'orderer_phone' => '010-'.$faker->numerify('####-####'), 'orderer_email' => $faker->email(), 'recipient_name' => $faker->name(), 'recipient_phone' => '010-'.$faker->numerify('####-####'), 'zipcode' => $faker->numerify('#####'), 'address' => $faker->address(), 'address_detail' => $faker->optional()->sentence(3), 'delivery_memo' => $faker->optional()->sentence(), 'recipient_country_code' => 'KR', ]; } /** * 배송지 주소 * * @return static */ public function shipping(): static { return $this->state(fn (array $attributes) => [ 'address_type' => 'shipping', ]); } /** * 청구지 주소 * * @return static */ public function billing(): static { return $this->state(fn (array $attributes) => [ 'address_type' => 'billing', ]); } /** * 특정 주문의 주소 * * @param Order $order * @return static */ public function forOrder(Order $order): static { return $this->state(fn (array $attributes) => [ 'order_id' => $order->id, ]); } }