From bb19dbd6d63b2b7b197f59434711b24c55603f88 Mon Sep 17 00:00:00 2001 From: Anton Komarev <1849174+antonkomarev@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:32:39 +0300 Subject: [PATCH] Migrate to Console AsCommand attribute (#215) * Migrate to Console AsCommand attribute * Anonymous migration classes * Fix tests run --- .github/workflows/tests.yml | 32 ++----------------- .travis.yml | 24 -------------- README.md | 4 +-- composer.json | 12 +++---- ...7_22_000100_create_love_reacters_table.php | 4 +-- ..._22_001000_create_love_reactants_table.php | 8 ++--- ...01500_create_love_reaction_types_table.php | 4 +-- ..._22_002000_create_love_reactions_table.php | 4 +-- ..._love_reactant_reaction_counters_table.php | 4 +-- ...te_love_reactant_reaction_totals_table.php | 4 +-- phpunit.xml.dist | 4 +-- src/Console/Commands/ReactionTypeAdd.php | 9 ++---- src/Console/Commands/Recount.php | 9 ++---- src/Console/Commands/RegisterReactants.php | 9 ++---- src/Console/Commands/RegisterReacters.php | 9 ++---- src/Console/Commands/SetupReactable.php | 9 ++---- src/Console/Commands/SetupReacterable.php | 9 ++---- src/Console/Commands/UpgradeV5ToV6.php | 9 ++---- src/Console/Commands/UpgradeV7ToV8.php | 9 ++---- .../Database/Stubs/AddForeignColumn.stub | 4 +-- .../Stubs/AddForeignNullableColumn.stub | 4 +-- tests/TestCase.php | 2 +- ...016_09_02_173301_create_articles_table.php | 4 +-- ...016_09_02_173301_create_entities_table.php | 4 +-- ...1_create_entities_with_morph_map_table.php | 4 +-- ...1_create_morph_mapped_reactables_table.php | 4 +-- ...create_morph_mapped_reacterables_table.php | 4 +-- .../2016_09_02_173301_create_people_table.php | 4 +-- .../2016_09_02_173301_create_users_table.php | 4 +-- .../2016_09_02_173302_create_bots_table.php | 4 +-- 30 files changed, 63 insertions(+), 155 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb0452ed..e6273c86 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,38 +9,10 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest ] - php: [ 7.2, 7.3, 7.4, 8.0, 8.1 ] - laravel: [ 6.*, 7.*, 8.*, 9.* ] + php: [ 8.0, 8.1 ] + laravel: [ 9.* ] dependency-version: [ prefer-lowest, prefer-stable ] - exclude: - - laravel: 6.* - dependency-version: prefer-lowest - - laravel: 7.* - dependency-version: prefer-lowest - - laravel: 8.* - dependency-version: prefer-lowest - - laravel: 9.* - dependency-version: prefer-lowest - - laravel: 6.* - php: 8.1 - - laravel: 7.* - php: 8.1 - - laravel: 8.* - php: 7.2 - - laravel: 9.* - php: 7.2 - - laravel: 9.* - php: 7.3 - - laravel: 9.* - php: 7.4 include: - - laravel: 6.* - testbench: 4.* - - laravel: 7.* - testbench: 5.* - - laravel: 8.* - testbench: 6.* - legacy-factories: 1.* - laravel: 9.* testbench: 7.* legacy-factories: 1.* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 004b57be..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - - 8.0 - -env: - global: - - setup=basic - -before_script: - - composer config discard-changes true - - if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction; fi - - if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable; fi - - if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi - - if [ $(phpenv version-name) = '7.3' ]; then composer require laravel/legacy-factories --dev; fi - - if [ $(phpenv version-name) = '7.4' ]; then composer require laravel/legacy-factories --dev; fi - - if [ $(phpenv version-name) = '8.0' ]; then composer require laravel/legacy-factories --dev; fi - -script: - - ./vendor/bin/phpstan analyse -c .phpstan.neon - - ./vendor/bin/phpunit -c phpunit.xml.dist --verbose diff --git a/README.md b/README.md index 1bfeb38a..8d63585f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

Discord Releases -Build Status +Build StyleCI Code Quality License @@ -18,7 +18,7 @@ Make any model reactable in a minutes! There are many implementations in modern applications: -- Github Reactions +- GitHub Reactions - Facebook Reactions - YouTube Likes - Slack Reactions diff --git a/composer.json b/composer.json index 4cd420a4..9e7b9b38 100644 --- a/composer.json +++ b/composer.json @@ -46,16 +46,16 @@ "docs": "https://laravel-love.readme.io" }, "require": { - "php": "^7.2.5|^8.0", - "illuminate/database": "^6.20.14|^7.30.4|^8.24|^9.0", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0" + "php": "^8.0", + "illuminate/database": "^9.0", + "illuminate/support": "^9.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/database": "~3.7.0|~3.8.0|^4.0|^5.0|^6.0|^7.0", - "orchestra/testbench": "~3.7.0|~3.8.0|^4.0|^5.0|^6.0|^7.0", + "orchestra/database": "^7.0", + "orchestra/testbench": "^7.0", "phpstan/phpstan": "^0.12.29", - "phpunit/phpunit": "^7.5|^8.0|^9.0" + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { diff --git a/database/migrations/2018_07_22_000100_create_love_reacters_table.php b/database/migrations/2018_07_22_000100_create_love_reacters_table.php index eaac9a60..d808a625 100644 --- a/database/migrations/2018_07_22_000100_create_love_reacters_table.php +++ b/database/migrations/2018_07_22_000100_create_love_reacters_table.php @@ -15,7 +15,7 @@ use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; -final class CreateLoveReactersTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -42,4 +42,4 @@ public function down(): void { $this->schema->dropIfExists((new Reacter())->getTable()); } -} +}; diff --git a/database/migrations/2018_07_22_001000_create_love_reactants_table.php b/database/migrations/2018_07_22_001000_create_love_reactants_table.php index 6b43f98e..f2e1c84b 100644 --- a/database/migrations/2018_07_22_001000_create_love_reactants_table.php +++ b/database/migrations/2018_07_22_001000_create_love_reactants_table.php @@ -15,7 +15,7 @@ use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; -final class CreateLoveReactantsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -24,7 +24,7 @@ final class CreateLoveReactantsTable extends Migration */ public function up(): void { - $this->schema->create((new Reactant)->getTable(), function (Blueprint $table) { + $this->schema->create((new Reactant())->getTable(), function (Blueprint $table) { $table->bigIncrements('id'); $table->string('type'); $table->timestamps(); @@ -40,6 +40,6 @@ public function up(): void */ public function down(): void { - $this->schema->dropIfExists((new Reactant)->getTable()); + $this->schema->dropIfExists((new Reactant())->getTable()); } -} +}; diff --git a/database/migrations/2018_07_22_001500_create_love_reaction_types_table.php b/database/migrations/2018_07_22_001500_create_love_reaction_types_table.php index a09a1ead..3b2ef4c6 100644 --- a/database/migrations/2018_07_22_001500_create_love_reaction_types_table.php +++ b/database/migrations/2018_07_22_001500_create_love_reaction_types_table.php @@ -15,7 +15,7 @@ use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; -final class CreateLoveReactionTypesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -43,4 +43,4 @@ public function down(): void { $this->schema->dropIfExists((new ReactionType())->getTable()); } -} +}; diff --git a/database/migrations/2018_07_22_002000_create_love_reactions_table.php b/database/migrations/2018_07_22_002000_create_love_reactions_table.php index b2885dac..cc8ab21d 100644 --- a/database/migrations/2018_07_22_002000_create_love_reactions_table.php +++ b/database/migrations/2018_07_22_002000_create_love_reactions_table.php @@ -18,7 +18,7 @@ use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; -final class CreateLoveReactionsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -80,4 +80,4 @@ public function down(): void { $this->schema->dropIfExists((new Reaction())->getTable()); } -} +}; diff --git a/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php b/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php index c2b7d030..50ad97fb 100644 --- a/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php +++ b/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php @@ -15,7 +15,7 @@ use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; -final class CreateLoveReactantReactionCountersTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -59,4 +59,4 @@ public function down(): void { $this->schema->dropIfExists((new ReactionCounter())->getTable()); } -} +}; diff --git a/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php b/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php index 694a7ffd..0e9008ce 100644 --- a/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php +++ b/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php @@ -15,7 +15,7 @@ use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; -final class CreateLoveReactantReactionTotalsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -48,4 +48,4 @@ public function down(): void { $this->schema->dropIfExists((new ReactionTotal())->getTable()); } -} +}; diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f20e9e3e..d9ae0e28 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,13 +21,13 @@ - + - + diff --git a/src/Console/Commands/ReactionTypeAdd.php b/src/Console/Commands/ReactionTypeAdd.php index 95fdb20a..436ed1c0 100644 --- a/src/Console/Commands/ReactionTypeAdd.php +++ b/src/Console/Commands/ReactionTypeAdd.php @@ -16,17 +16,12 @@ use Cog\Laravel\Love\ReactionType\Models\ReactionType; use Illuminate\Console\Command; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +#[AsCommand(name: 'love:reaction-type-add')] final class ReactionTypeAdd extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:reaction-type-add'; - /** * The console command description. * diff --git a/src/Console/Commands/Recount.php b/src/Console/Commands/Recount.php index 54dd478b..6e00ea46 100644 --- a/src/Console/Commands/Recount.php +++ b/src/Console/Commands/Recount.php @@ -21,17 +21,12 @@ use Illuminate\Console\Command; use Illuminate\Contracts\Bus\Dispatcher as DispatcherInterface; use Illuminate\Database\Eloquent\Relations\Relation; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +#[AsCommand(name: 'love:recount')] final class Recount extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:recount'; - /** * The console command description. * diff --git a/src/Console/Commands/RegisterReactants.php b/src/Console/Commands/RegisterReactants.php index 7dbb201b..e2b9e1a1 100644 --- a/src/Console/Commands/RegisterReactants.php +++ b/src/Console/Commands/RegisterReactants.php @@ -18,17 +18,12 @@ use Illuminate\Console\Command; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\Relation; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +#[AsCommand(name: 'love:register-reactants')] final class RegisterReactants extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:register-reactants'; - /** * The console command description. * diff --git a/src/Console/Commands/RegisterReacters.php b/src/Console/Commands/RegisterReacters.php index cece163f..97e26368 100644 --- a/src/Console/Commands/RegisterReacters.php +++ b/src/Console/Commands/RegisterReacters.php @@ -18,17 +18,12 @@ use Illuminate\Console\Command; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\Relation; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +#[AsCommand(name: 'love:register-reacters')] final class RegisterReacters extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:register-reacters'; - /** * The console command description. * diff --git a/src/Console/Commands/SetupReactable.php b/src/Console/Commands/SetupReactable.php index a7dc1dc5..3494a1ef 100644 --- a/src/Console/Commands/SetupReactable.php +++ b/src/Console/Commands/SetupReactable.php @@ -24,17 +24,12 @@ use Illuminate\Support\Composer; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +#[AsCommand(name: 'love:setup-reactable')] final class SetupReactable extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:setup-reactable'; - /** * The console command description. * diff --git a/src/Console/Commands/SetupReacterable.php b/src/Console/Commands/SetupReacterable.php index 5b55e777..b3a3c893 100644 --- a/src/Console/Commands/SetupReacterable.php +++ b/src/Console/Commands/SetupReacterable.php @@ -24,17 +24,12 @@ use Illuminate\Support\Composer; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +#[AsCommand(name: 'love:setup-reacterable')] final class SetupReacterable extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:setup-reacterable'; - /** * The console command description. * diff --git a/src/Console/Commands/UpgradeV5ToV6.php b/src/Console/Commands/UpgradeV5ToV6.php index 55b7b028..bcbd3b2b 100644 --- a/src/Console/Commands/UpgradeV5ToV6.php +++ b/src/Console/Commands/UpgradeV5ToV6.php @@ -25,16 +25,11 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'love:upgrade-v5-to-v6')] final class UpgradeV5ToV6 extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:upgrade-v5-to-v6'; - /** * The console command description. * diff --git a/src/Console/Commands/UpgradeV7ToV8.php b/src/Console/Commands/UpgradeV7ToV8.php index 757633d1..1106dd0e 100644 --- a/src/Console/Commands/UpgradeV7ToV8.php +++ b/src/Console/Commands/UpgradeV7ToV8.php @@ -21,16 +21,11 @@ use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'love:upgrade-v7-to-v8')] final class UpgradeV7ToV8 extends Command { - /** - * The console command name. - * - * @var string - */ - protected static $defaultName = 'love:upgrade-v7-to-v8'; - /** * The console command description. * diff --git a/src/Support/Database/Stubs/AddForeignColumn.stub b/src/Support/Database/Stubs/AddForeignColumn.stub index fae38eb7..bd5f127c 100644 --- a/src/Support/Database/Stubs/AddForeignColumn.stub +++ b/src/Support/Database/Stubs/AddForeignColumn.stub @@ -15,7 +15,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class DummyClass extends Migration +return new class extends Migration { public function up(): void { @@ -36,4 +36,4 @@ final class DummyClass extends Migration $table->dropColumn('DummyForeignColumn'); }); } -} +}; diff --git a/src/Support/Database/Stubs/AddForeignNullableColumn.stub b/src/Support/Database/Stubs/AddForeignNullableColumn.stub index bbea1bc2..7c6560a9 100644 --- a/src/Support/Database/Stubs/AddForeignNullableColumn.stub +++ b/src/Support/Database/Stubs/AddForeignNullableColumn.stub @@ -15,7 +15,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class DummyClass extends Migration +return new class extends Migration { public function up(): void { @@ -36,4 +36,4 @@ final class DummyClass extends Migration $table->dropColumn('DummyForeignColumn'); }); } -} +}; diff --git a/tests/TestCase.php b/tests/TestCase.php index d43190db..5d976a8b 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -83,7 +83,7 @@ private function migrateUnitTestTables(): void { $this->loadMigrationsFrom(__DIR__ . '/database/migrations'); - $this->artisan('migrate', ['--database' => 'sqlite'])->run(); + $this->artisan('migrate')->run(); } /** diff --git a/tests/database/migrations/2016_09_02_173301_create_articles_table.php b/tests/database/migrations/2016_09_02_173301_create_articles_table.php index e1bdafad..8bf1eb91 100644 --- a/tests/database/migrations/2016_09_02_173301_create_articles_table.php +++ b/tests/database/migrations/2016_09_02_173301_create_articles_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreateArticlesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -41,4 +41,4 @@ public function down(): void { Schema::dropIfExists('articles'); } -} +}; diff --git a/tests/database/migrations/2016_09_02_173301_create_entities_table.php b/tests/database/migrations/2016_09_02_173301_create_entities_table.php index 3c07f145..20e1f210 100644 --- a/tests/database/migrations/2016_09_02_173301_create_entities_table.php +++ b/tests/database/migrations/2016_09_02_173301_create_entities_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreateEntitiesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -41,4 +41,4 @@ public function down(): void { Schema::dropIfExists('entities'); } -} +}; diff --git a/tests/database/migrations/2016_09_02_173301_create_entities_with_morph_map_table.php b/tests/database/migrations/2016_09_02_173301_create_entities_with_morph_map_table.php index 99eed522..b1c75e01 100644 --- a/tests/database/migrations/2016_09_02_173301_create_entities_with_morph_map_table.php +++ b/tests/database/migrations/2016_09_02_173301_create_entities_with_morph_map_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreateEntitiesWithMorphMapTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -41,4 +41,4 @@ public function down(): void { Schema::dropIfExists('entities_with_morph_map'); } -} +}; diff --git a/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reactables_table.php b/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reactables_table.php index 29778987..ff3d5efb 100644 --- a/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reactables_table.php +++ b/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reactables_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreateMorphMappedReactablesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -41,4 +41,4 @@ public function down(): void { Schema::dropIfExists('morph_mapped_reactables'); } -} +}; diff --git a/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reacterables_table.php b/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reacterables_table.php index 8a320b09..8adeaf4e 100644 --- a/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reacterables_table.php +++ b/tests/database/migrations/2016_09_02_173301_create_morph_mapped_reacterables_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreateMorphMappedReacterablesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -41,4 +41,4 @@ public function down(): void { Schema::dropIfExists('morph_mapped_reacterables'); } -} +}; diff --git a/tests/database/migrations/2016_09_02_173301_create_people_table.php b/tests/database/migrations/2016_09_02_173301_create_people_table.php index 6e1cc21b..4331fdee 100644 --- a/tests/database/migrations/2016_09_02_173301_create_people_table.php +++ b/tests/database/migrations/2016_09_02_173301_create_people_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreatePeopleTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -39,4 +39,4 @@ public function down(): void { Schema::dropIfExists('people'); } -} +}; diff --git a/tests/database/migrations/2016_09_02_173301_create_users_table.php b/tests/database/migrations/2016_09_02_173301_create_users_table.php index fa66a6a2..3523de6e 100644 --- a/tests/database/migrations/2016_09_02_173301_create_users_table.php +++ b/tests/database/migrations/2016_09_02_173301_create_users_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreateUsersTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -42,4 +42,4 @@ public function down(): void { Schema::dropIfExists('users'); } -} +}; diff --git a/tests/database/migrations/2016_09_02_173302_create_bots_table.php b/tests/database/migrations/2016_09_02_173302_create_bots_table.php index 2091d6be..ea0f6446 100644 --- a/tests/database/migrations/2016_09_02_173302_create_bots_table.php +++ b/tests/database/migrations/2016_09_02_173302_create_bots_table.php @@ -15,7 +15,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class CreateBotsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -41,4 +41,4 @@ public function down(): void { Schema::dropIfExists('bots'); } -} +};