'item_type', 'code' => 'FG', 'name' => '완제품', 'tenant_id' => $tenantId], ['code_group' => 'item_type', 'code' => 'PT', 'name' => '반제품', 'tenant_id' => $tenantId], ['code_group' => 'item_type', 'code' => 'SM', 'name' => '부자재', 'tenant_id' => $tenantId], ['code_group' => 'item_type', 'code' => 'RM', 'name' => '원자재', 'tenant_id' => $tenantId], ['code_group' => 'item_type', 'code' => 'CS', 'name' => '소모품', 'tenant_id' => $tenantId], ]; foreach ($itemTypes as $index => $item) { DB::table('common_codes')->updateOrInsert( [ 'code_group' => $item['code_group'], 'code' => $item['code'], 'tenant_id' => $item['tenant_id'], ], array_merge($item, [ 'sort_order' => $index + 1, 'is_active' => true, 'created_at' => now(), 'updated_at' => now(), ]) ); } $this->command->info('ItemTypeSeeder: '.count($itemTypes).'개 item_type 코드가 시딩되었습니다.'); } }