Changing other field types in Laravel in migration is a really simple task but modifying existing ENUM type is a bit different so far and we need to write SQL query to make the change. Here is an example of modifying enum column in Laravel migration. In this example we have added one new enum value.
Up method
Schema::table('animals', function (Blueprint $table) {
DB::statement("
ALTER TABLE
animals
MODIFY COLUMN
type ENUM('cat', 'rat', 'mice', 'dog')
DEFAULT 'cat'
");
// Other migration changes if any
});
Down method
Schema::table('animals', function (Blueprint $table) {
DB::statement("
ALTER TABLE
animals
MODIFY COLUMN
type ENUM('cat', 'rat', 'mice')
DEFAULT 'cat'
");
// Other migration changes if any
});