string('channel_type', 100)->primary(); $t->string('logo', 2048)->nullable(); $t->timestamps(); }); if (Schema::hasColumn('recharge_channel', 'logo')) { foreach (DB::table('recharge_channel')->where('data_type', 1)->whereNull('deleted_at')->whereNotNull('logo')->where('logo', '<>', '')->orderBy('sort')->orderBy('id')->get() as $channel) { DB::table('recharge_method_logos')->insertOrIgnore(['channel_type' => $channel->type, 'logo' => $channel->logo, 'created_at' => now(), 'updated_at' => now()]); } } } public function down(): void { Schema::dropIfExists('recharge_method_logos'); } };