true]); $rows = DB::table('migrations_logs') ->where('source_system', 'wp') ->where('source_table', 'wp_posts') ->where('target_table', 'entries') ->get(['source_id', 'target_id']); $this->info("{$rows->count()} entries touched."); $this->withProgressBar($rows, function ($row) use ($converter) { $rawHtml = DB::connection('old_wp')->table('posts') ->where('ID', $row->source_id) ->value('post_content'); if ($rawHtml === null) return; $markdown = trim($rawHtml) === '' ? $rawHtml : $converter->convert(MigrationHelpers::wpAutoP($rawHtml)); DB::table('entries')->where('id', $row->target_id)->update([ 'description' => $markdown, 'updated_at' => now(), ]); }); $this->newLine(); $this->info('Process finished.'); return self::SUCCESS; } }