ReflectionException: Class ClassName does not exist - Laravel

后端 未结 22 1201
无人共我
无人共我 2020-11-29 04:39

As soon, I am typing php artisan db:seed command.

I\'m getting Error Like:

[ReflectionException]
Clas

22条回答
  •  粉色の甜心
    2020-11-29 05:07

    I had this error when trying to reach an endpoint in a custom route file, that had a namespace prepended in RouteServiceProvider

    • The namespace in the class was correct.
    • The file path of the class file was correct.
    • The controller call from the routes file was correct (when not taking the prepended namespace from the RouteServiceProvider into account)
    • The default $router->group(['namespace' ...]) in the RouteServiceProvider was incorrect.

    Updating the namespace in the RouteServiceProvider solved the issue, as the relative controller path specified in the routes file was now resolving correctly.

提交回复
热议问题