id(); $table->foreignId('tournament_id')->constrained(); $table->foreignId('user_id')->constrained(); $table->boolean('denied')->default(false); $table->timestamps(); $table->unique(['tournament_id', 'user_id']); }); Schema::table('tournaments', function(Blueprint $table) { $table->boolean('accept_applications')->default(false); }); Schema::table('participants', function(Blueprint $table) { $table->unique(['tournament_id', 'user_id']); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('tournaments', function(Blueprint $table) { $table->dropColumn('accept_applications'); }); Schema::dropIfExists('applications'); } };