From 0663453dc8b4c6422e58bdda7f1c076b5da3332f Mon Sep 17 00:00:00 2001 From: ardinholtkamp Date: Wed, 30 Nov 2022 10:34:33 +0100 Subject: [PATCH] Change migrations in our code format --- stubs/migration.create.stub | 11 +++++++---- stubs/migration.update.stub | 22 ++++++++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/stubs/migration.create.stub b/stubs/migration.create.stub index 1a081c6..7595efa 100755 --- a/stubs/migration.create.stub +++ b/stubs/migration.create.stub @@ -10,10 +10,13 @@ return new class extends Migration { public function up(): void { - Schema::create('{{ table }}', function (Blueprint $table) { - $table->id(); - $table->timestamps(); - }); + Schema::create( + '{{ table }}', + function (Blueprint $table) { + $table->id(); + $table->timestamps(); + }, + ); } public function down(): void diff --git a/stubs/migration.update.stub b/stubs/migration.update.stub index cadcbff..249dbeb 100755 --- a/stubs/migration.update.stub +++ b/stubs/migration.update.stub @@ -6,19 +6,25 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -final class {{ class }} extends Migration +return new class extends Migration { public function up(): void { - Schema::table('{{ table }}', function (Blueprint $table) { - // - }); + Schema::table( + '{{ table }}', + function (Blueprint $table) { + // + }, + ); } public function down(): void { - Schema::table('{{ table }}', function (Blueprint $table) { - // - }); + Schema::table( + '{{ table }}', + function (Blueprint $table) { + // + }, + ); } -} +};