add unique constraint on two columns laravel migration code example Example: laravel unique multiple columns $table->unique(['mytext', 'user_id']);