Laravel development uses Artisan to create a controller and reports an error. Please help!
怪我咯
怪我咯 2017-05-16 16:56:49
0
3
474

Yesterday I used the php artisan controller:make PostController command to create the controller, then deleted it and re-created it several times, no problem.

I got an error when I tried to create PostController today.

{"error":

    {"type":"ReflectionException","message":"Class PostController does not exist",
     "file":"D:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Routing\ControllerInspector.php","line":28}

}

Then I found that changing to another controller or even another artisan command reported the same error. Do not you know why?

It is suspected that the problem was caused by repeated operations yesterday. Trying to execute composer dump-autoload and composer clear still did not solve the problem. . . And only this project has problems, other projects are normal. What is the reason for this? Please help!

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
左手右手慢动作

It may be that there is an error in the artisan file. Copy it from another project and try it.

洪涛

This problem is that you first defined a controller that does not exist in the routing, just remove it.

伊谢尔伦

php artisan make:controller PostController, your command is wrong

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template