Migration error : PDOMySql\Driver not found的解决办法
$ composer require doctrine/dbal
$ php artisan migrate
运行后报错:
Migrating: 2020_12_11_115553_add_phone_to_users_table
Symfony\Component\Debug\Exception\FatalThrowableError : Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found
google后发现是dbal的版本不兼容:
StackOverflow - artisan migration error “Class ‘Doctrine\DBAL\Driver\PDOMySql\Driver’ not found”,
Issues·doctrine/dbal
将
"doctrine/dbal": "^3.0",
改为
"doctrine/dbal": "^2.0",
composer update
后,再次migrate发现可以领
可以的,老哥