command->info('=== 이커머스 모듈 시더 실행 시작 ==='); $this->command->newLine(); // 설치 필수 시더 (항상 실행) $this->call([ SequenceSeeder::class, ShippingTypeSeeder::class, ShippingCarrierSeeder::class, ClaimReasonSeeder::class, UserAddressSeeder::class, ]); // 샘플 시더 (--sample 옵션 시에만 실행) if ($this->shouldIncludeSample()) { $this->command->newLine(); $this->command->info('--- 이커머스 샘플 시더 실행 ---'); // 참조 데이터 샘플 시더 (count 불필요) $this->call([ Sample\EcommerceUserProfileSeeder::class, Sample\ProductNoticeTemplateSeeder::class, Sample\ProductCommonInfoSeeder::class, Sample\BrandSeeder::class, Sample\CategorySeeder::class, Sample\ProductLabelSeeder::class, Sample\ExtraFeeTemplateSeeder::class, Sample\ShippingPolicySeeder::class, ]); // count-aware 샘플 시더 (카운트 전파) $this->callWithCounts([ Sample\ProductSeeder::class, Sample\CouponSeeder::class, Sample\CartSeeder::class, Sample\OrderSeeder::class, Sample\MileageSeeder::class, Sample\ProductReviewSeeder::class, Sample\ProductInquirySeeder::class, Sample\NotificationLogSeeder::class, Sample\IdentityVerificationLogSeeder::class, ]); // 활동 로그 샘플 시더 (모든 샘플 데이터 생성 후 마지막에 실행) $this->call(ActivityLogSampleSeeder::class); } $this->command->newLine(); $this->command->info('=== 이커머스 모듈 시더 실행 완료 ==='); } /** * 카운트 옵션을 전파하며 시더를 실행합니다. * * @param array $classes 시더 클래스 목록 */ private function callWithCounts(array $classes): void { foreach ($classes as $class) { $seeder = $this->resolve($class); if (method_exists($seeder, 'setSeederCounts')) { $seeder->setSeederCounts($this->seederCounts); } $seeder->__invoke(); } } }