Skip to content

Commit

Permalink
Merge pull request #3 from coddin-web/feature/php-code-style-safe-mig…
Browse files Browse the repository at this point in the history
…rations

Change migrations in our code format
  • Loading branch information
ardin0546 authored Nov 30, 2022
2 parents 6760879 + 0663453 commit 1ec4328
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
11 changes: 7 additions & 4 deletions stubs/migration.create.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 14 additions & 8 deletions stubs/migration.update.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
//
},
);
}
}
};

0 comments on commit 1ec4328

Please sign in to comment.