down(); Schema::create('cug_owners', function (Blueprint $table) { $table->integer('cug_id'); $table->integer('user_id')->unsigned(); $table->foreign('user_id')->references('id')->on('users'); $table->foreign('cug_id')->references('id')->on('cugs'); $table->unique(['user_id','cug_id']); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('cug_owners'); } }