bigIncrements('id'); $table->bigInteger('user_id')->unsigned()->index(); $table->bigInteger('filterable_id')->unsigned(); $table->string('filterable_type'); $table->string('filter_type')->default('block')->index(); $table->unique([ 'user_id', 'filterable_id', 'filterable_type', 'filter_type', ], 'filter_unique'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('user_filters'); } }