LoginSignup
7
5

More than 5 years have passed since last update.

Laravel artisanコマンドでエラーが出る時の対処法

Last updated at Posted at 2017-10-18

Laravelをアップグレードした際などに出るエラーでartisanコマンドが動かなくなる時があります。この記事では、その時の対処法を紹介します。

問題

artisanコマンドを入力した際にこのようなエラーが出る。

[Symfony\Component\Debug\Exception\FatalErrorException]         
Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found  

対策

このエラーは次のように use 宣言を変更することで対処できます。

直接Illuminate\Console\AppNamespaceDetectorTraitを使用しているのであれば、代わりにIlluminate\Console\AppNamespaceDetectorTraitを使用するようにコードを更新してください。
アップグレードガイド 5.4 Laravel

// vender\laralib\l5scaffold\src\Makes\MakeController.php
- use Illuminate\Console\AppNamespaceDetectorTrait;
+ use Illuminate\Console\DetectsApplicationNamespace;

参考

https://readouble.com/laravel/5.4/ja/upgrade.html
http://am1tanaka.hatenablog.com/entry/2017/02/14/142601

7
5
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
7
5