Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AShishWeb's avatar

Change Column name and datatype

I have a users table for my project, i already have column Role ( enum ['admin', 'student', 'teacher']) in my table, and i want to change the designation column ('string'), but as per laravel docs we cannot update the column with enum datatype, so in this case what should i do, i am new to laravel.

0 likes
1 reply
realrandyallen's avatar

You can run it as a raw query in a new migration that modifies the column:

public function up()
{
    DB::statement("ALTER TABLE users MODIFY COLUMN role VARCHAR(50) NULL");
}

Please or to participate in this conversation.