regepanのはてなブログ

個人的なメモ帳レベルの文章。

Laravel 7.11.0 で カラム名を変更する方法

ターミナルにて。

$ php artisan migrate
Migrating: 2020_05_16_165342_rename_author_id_to_user_id_on_posts_table

   Error 

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

  at vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php:64
    60|      * @return \Doctrine\DBAL\Driver\PDOMySql\Driver
    61|      */
    62|     protected function getDoctrineDriver()
    63|     {
  > 64|         return new DoctrineDriver;
    65|     }
    66| }
    67| 

      +8 vendor frames 
  9   database/migrations/2020_05_16_165342_rename_author_id_to_user_id_on_posts_table.php:18
      Illuminate\Support\Facades\Facade::__callStatic("table")

      +22 vendor frames 
  32  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

解決方法

$ composer require doctrine/dbal

PHPフレームワークLaravel入門 第2版

PHPフレームワークLaravel入門 第2版

PHPフレームワーク Laravel実践開発

PHPフレームワーク Laravel実践開発

速習 Laravel 6 速習シリーズ

速習 Laravel 6 速習シリーズ

LaravelとNuxtではじめるSNSシェアアプリ開発 (技術の泉シリーズ(NextPublishing))

LaravelとNuxtではじめるSNSシェアアプリ開発 (技術の泉シリーズ(NextPublishing))

  • 作者:峯岸 海
  • 発売日: 2020/05/01
  • メディア: オンデマンド (ペーパーバック)