DB::statement('ALTER TABLE add primary key laravel migration code example Example: laravel migration with primary key $table->string('code', 30)->primary();