diff --git a/src/Commands/MigrateCommand.php b/src/Commands/MigrateCommand.php index deb301d..166e4a9 100644 --- a/src/Commands/MigrateCommand.php +++ b/src/Commands/MigrateCommand.php @@ -54,7 +54,13 @@ public function handle(File $file) }); $blueprintsWithSeotamicFields = $blueprints->filter(function ($blueprint) { - return $blueprint->hasSection('SEO') || $blueprint->hasSection('Social'); + if (method_exists($blueprint, 'hasSection')) { + return $blueprint->hasSection('SEO') || $blueprint->hasSection('Social'); + } + + if (method_exists($blueprint, 'hasTab')) { + return $blueprint->hasTab('SEO') || $blueprint->hasTab('Social'); + } }); $skippedBlueprints = []; @@ -65,8 +71,17 @@ public function handle(File $file) if ($this->confirm('Do you want to remove the SEOtamic fields from this blueprint?', true)) { $this->info('Removing SEOtamic fields from blueprint: ' . $blueprint->handle()); - $blueprint->removeSection('SEO'); - $blueprint->removeSection('Social'); + + if (method_exists($blueprint, 'removeSection')) { + $blueprint->removeSection('SEO'); + $blueprint->removeSection('Social'); + } + + if (method_exists($blueprint, 'removeTab')) { + $blueprint->removeTab('SEO'); + $blueprint->removeTab('Social'); + } + $blueprint->save(); } else { $this->info('Skipping blueprint: ' . $blueprint->handle());