bigIncrements('id'); $table->timestamps(); $table->string('name')->unique(); }); Schema::create('posts_tags', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamps(); $table->bigInteger('post_id'); $table->bigInteger('tag_id'); $table->foreign('post_id')->references('id')->on('posts'); $table->foreign('tag_id')->references('id')->on('tags'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('tags'); Schema::dropIfExists('posts_tags'); } }