1Schema::table('tableName', function($table)
2{
3 $table->string('column-name')->unique(); //notice the parenthesis I added
4});
1To rollback one step:
2
3php artisan migrate:rollback
4
5To rollback multiple steps:
6
7php artisan migrate:rollback --step=[x]
8
9To drop all tables and reload all migrations:
10
11php artisan migrate:fresh
1Schema::table('manufacturers', function($table)
2{
3 $table->string('name')->unique();
4});
5
1use Illuminate\Database\Schema\Blueprint;
2use Illuminate\Support\Facades\Schema;
3
4Schema::table('users', function (Blueprint $table) {
5 $table->string('email')->unique();
6});