table('node') ->where('node_type_id', 'Forum') ->select('node_id', 'title') ->get() ; $this->info("{$forums->count()} forums found."); $forumMap = []; foreach ($forums as $forum) { $newId = $this->ask("New ID for {$forum->title}"); if( $newId !== null && $newId !== '' ){ $map[$forum->node_id] = (int) $newId; } } DB::table('migration_settings') ->updateOrInsert( [ 'key' => 'old_xf_node_to_new_xf_node'], [ 'value' => json_encode($map), 'updated_at' => now() ], ); $this->info("Config saved."); } }