The Laravel team released Laravel 8.37 with anonymous migration support, which solves a GitHub issue with migration class name collisions. The core of the problem is that if multiple migrations have the same class name, it'll cause issues when trying to recreate the database from scratch. Here's an example from the pull request tests:
1use Illuminate\Database\Migrations\Migration; 2use Illuminate\Database\Schema\Blueprint; 3use Illuminate\Support\Facades\Schema; 4 5return new class extends Migration { 6 public function up( 7 { 8 Schema::table('people', function (Blueprint $table) { 9 $table->string('first_name')->nullable();10 });11 }12 13 public function down()14 {15 Schema::table('people', function (Blueprint $table) {16 $table->dropColumn('first_name');17 });18 }19};
Tip given by @nicksdot