artisan migration error “Class ‘Doctrine\DBAL\Driver\PDOMySql\Driver’ not found”,

Tags: , , ,



When trying to run a migration I get the error Artisan migration

error:Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found

I have read the questions here and also see the notes to add:

doctrine/dbal": "~2.3 in the requires section of composer.json

Github Bug Report

However, I don’t understand what has happened. I created table a few days ago with no issue.

I can’t figure out what to do after adding that dependency in composer.son.

I don’t want to accidentally update any other packages.

Answer

The doctrine/dbal dependency needs to be added to your composer.json

composer require doctrine/dbal

For more information check laravel #Modifying Columns



Source: stackoverflow