LoginSignup
4
1

More than 5 years have passed since last update.

Laravel5.6でscaffoldが動かなかった件

Last updated at Posted at 2018-04-03

PHPの大人気フレームワークLaravelの5.5や5.6だと、scaffoldすると、3箇所エラーが出ます。

Macです。xxxxはホームディレクトリの名前です。
/Users/xxxx/todo/vendor/laralib/l5scaffold/src/Commands/ScaffoldMakeCommand.php

​の21行目の

use AppNamespaceDetectorTrait, MakerTrait;
が嘘なので、
use DetectsApplicationNamespace​, MakerTrait;
に変えます。

同様に6行目も間違いなので
use Illuminate\Console\DetectsApplicationNamespace;​
と変えます。

次に
Method Laralib\L5scaffold\Commands\ScaffoldMakeCommand::handle() does not exist

とでるので、
/Users/xxxx/todo/vendor/laralib/l5scaffold/src/Commands/ScaffoldMakeCommand.php

の一番最後に、関数を追加します。

public function handle() { return $this->fire(); }​

そして、最後に

Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found

とでるので、

/Users/xxxx/todo/vendor/laralib/l5scaffold/src/Makes/MakeController.php

の13行目を

use AppNamespaceDetectorTrait, MakerTrait;

から、

use DetectsApplicationNamespace​, MakerTrait;

にします。これで、scaffoldが動きます。

4
1
2

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
4
1