+ $jsonColumnsToUpdateByTable = [
+ 'settings' => ['value'],
+ ];
+
+ foreach ($jsonColumnsToUpdateByTable as $table => $columns) {
+ foreach ($columns as $column) {
+ $oldJson = trim(json_encode($oldUrl), '"');
+ $newJson = trim(json_encode($newUrl), '"');
+ $changeCount = $this->replaceValueInTable($table, $column, $oldJson, $newJson);
+ $this->info("Updated {$changeCount} JSON encoded rows in {$table}->{$column}");
+ }
+ }
+
+ $this->info('URL update procedure complete.');
+ $this->info('============================================================================');
+ $this->info('Be sure to run "php artisan cache:clear" to clear any old URLs in the cache.');
+ $this->info('============================================================================');
+