3
2

More than 3 years have passed since last update.

Laravelにて「.env.testing」がうまく読み込まれないときの対処法

Posted at

はじめに

マイグレーションファイルを追加して、以下のコマンドを実行したのですが、「Nothing to migrate.」となり、マイグレーションが実行されなかったので、対処法をまとめました

$ php artisan migrate --env=testing
Nothing to migrate.

Laravelのバージョン

$ php artisan --version
Laravel Framework 5.8.29

対処法

以下のコマンドを実行して、キャッシュをクリアすることで、マイグレーションが実行されました

$ php artisan config:clear
Configuration cache cleared!

$ php artisan migrate --env=testing
Migrating: 2019_12_17_150625_create_hoges_table
Migrated:  2019_12_17_150625_create_hoges_table (0.02 seconds)

終わりに

.env.testingを更新したときは、キャッシュクリアを忘れずにしようと思います

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2