/** * Run the migrations. * * @return void */ public function up() { Schema::table('leads', function (Blueprint $table) { //Give the moving column a temporary name: Schema::table('leads', function($table) { $table->renameColumn('status', 'status_old'); }); //Add a new column with the regular name: Schema::table('leads', function(Blueprint $table) { $table-> enum('status',['active', 'inactive', 'cancelled'])->nullable()->after('lead_source_id'); }); //Copy the data across to the new column: DB::table('leads')->update([ 'status' => DB::raw('status_old') ]); //Remove the old column: Schema::table('leads', function(Blueprint $table) { $table->dropColumn('status_old'); }); }); } /** * Reverse the migrations. * * @return void */ public function down() { // Schema::table('leads', function (Blueprint $table) { //Give the moving column a temporary name: Schema::table('leads', function($table) { $table->renameColumn('status', 'status_old'); }); //Add a new column with the regular name: Schema::table('leads', function(Blueprint $table) { $table-> enum('status',['active', 'inactive'])->nullable()->after('lead_source_id'); }); //Copy the data across to the new column: DB::table('leads')->update([ 'status' => DB::raw('status_old') ]); //Remove the old column: Schema::table('leads', function(Blueprint $table) { $table->dropColumn('status_old'); }); }); }$table->enum('animal_type',['cat','dog','unknown'])->default('unknown');Add Laravel enmu migration : ------------------------------ $table->enum('question_type', ['objective', 'subjective', 'multiple_choice']); Update Laravel enum migration : --------------------------------- DB::statement("ALTER TABLE users CHANGE COLUMN permissions permissions ENUM('admin', 'user', 'candidate') NOT NULL DEFAULT 'user'");$table->enum('gender',['Male','Female'])->default('Male');// For identifying user $table->enum('is_admin',['1','0'])->default('1'); // For User roles $table->enum('user_role',['admin','manager','quest'])->default('quest');DB::statement("ALTER TABLE users CHANGE COLUMN permissions permissions ENUM('admin', 'user', 'candidate') NOT NULL DEFAULT 'user'"); \DB::statement("ALTER TABLE users MODIFY COLUMN role ENUM('1','2','3')");<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class UpdateRoleColumn extends Migration { /** * Run the migrations. * * @return void */ public function up() { // \DB::statement("ALTER TABLE users MODIFY COLUMN role ENUM('1','2','3')"); } /** * Reverse the migrations. * * @return void */ public function down() { // } }