increments('id'); $table->string('name')->unique(); $table->timestamps(); }); Schema::create('post_tag', function (Blueprint $table) { $table->integer('post_id'); $table->integer('tag_id'); $table->primary(['post_id', 'tag_id']); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('post_tag'); Schema::dropIfExists('tags'); } }