【发布时间】:2020-02-15 06:22:35
【问题描述】:
我正在更新我的服务器代码,一切正常,甚至是迁移和播种。
但是当我尝试login URL 时,它给了我404 错误,所以我检查并在该过程中运行,然后在终端中运行PHP artisan route: list 命令。
并得到如下错误:
PHP artisan route: list
Illuminate\Contracts\Container\BindingResolutionException : Target class [App\Http\Controllers\Api\V1\UserController] does not exist.
at /var/www/html/x/vendor/laravel/framework/src/Illuminate/Container/Container.php:805
801|
802| try {
803| $reflector = new ReflectionClass($concrete);
804| } catch (ReflectionException $e) {
> 805| throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
806| }
807|
808| // If the type is not instantiable, the developer is attempting to resolve
809| // an abstract type such as an Interface or Abstract Class and there is
Exception trace:
1 Illuminate\Foundation\Console\RouteListCommand::Illuminate\Foundation\Console\{closure}()
[internal]:0
2 ReflectionException::("Class App\Http\Controllers\Api\V1\UserController does not exist")
/var/www/html/x/vendor/laravel/framework/src/Illuminate/Container/Container.php:803
Please use the argument -v to see more details.
它说找不到给定的控制器。我亲自检查了该文件夹并且它存在。权限是正确的,而且如果我在本地机器上运行相同的命令,我会在相同的代码上得到route list。
已尝试 composer dump-autoload 和 composer update 仍然没有使用,因为错误存在。那么这里的真正问题是什么。如何解决这个问题?
【问题讨论】:
-
你的本地操作系统是什么?
-
试试下面的命令:php artisan cache:clear
-
我的本地操作系统是mac。我也尝试清除服务器上的缓存、视图和路由
-
你的路线是什么?
-
来自 laravel 的正常认证路由
标签: laravel routes runtime-error vps