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