在遷移文件中up方法最上方加上下面這一行代碼便可:app
Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
public function up() { Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); Schema::table('medicines', function (Blueprint $table) { }); }