我使用的是Laravel 6.0,我试图用artisan route:list列出我的所有路由,但它失败并返回:

Illuminate\Contracts\Container\BindingResolutionException:目标 类[App\http\Controlders\SessionsController]不存在.

at /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Container/Container.php:806 802| 803| try { 804| $reflector = new ReflectionClass($concrete); 805| } catch (ReflectionException $e) { > 806| throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e); 807| } 808| 809| // If the type is not instantiable, the developer is attempting to resolve 810| // an abstract type such as an Interface or Abstract Class and there is

异常跟踪:

1 Illuminate\Foundation\Console\RouteListCommand::Illuminate\Foundation\Console{closure}(Object(Illuminate\Routing\Route)) [internal]:0

2 ReflectionException::("类App\Http\Controllers\SessionController不存在")

3 ReflectionClass::_构造("App\Http\Controllers\sessioncontroller")

到目前为止,我只有一个非常简单的网站.php路由文件:

Route::get('/', function () {
    return view('index');
});


Route::prefix('app')->group(function () {
    // Registration routes
    Route::get('registration/create', 'RegistrationController@create')->name('app-registration-form');
});


// Templates
Route::get('templates/ubold/{any}', 'UboldController@index');

知道我如何调试这个问题吗?

推荐答案

运行此命令

  php artisan config:cache 

Laravel相关问答推荐

Laravel模型嵌入嵌套模型时只附加属性

为什么只删除了最后一个Like,而没有删除选中的?

如何使用PHP版本8.2.6安装beyondcode/laravel-websockets软件包?

为什么使用 created_at 表在迁移错误中创建表?

处理程序类中的错误 - Laravel

如何在 vue 模板中引用 laravel csrf 字段

Laravel/Eloquent:致命错误:在非对象上调用成员函数 connection()

Laravel API 版本控制文件夹 struct

Laravel + SQLite = SQLSTATE[HY000]一般错误:8次try 写入只读数据库

Laravel 5文件夹 struct 中的文件保存在哪里?

Laravel Session 总是改变 Laravel 5.4 中的每个刷新/请求

在 Laravel Blade 中转义 vue.js 数据绑定语法?

Laravel - 自定义时间戳列名称

使用 laravel eloquent 关系检索除 NULL 之外的所有记录

如何从 Windows 命令提示符在 Laravel 中运行 PHPUnit

Laravel 用户能力

Laravel 4 - 一个表单中有两个提交按钮,并且两个提交都由不同的操作处理

Laravel 手动登录功能

在 Laravel 中翻译特定语言

带有 Xdebug 的 Laravel 5 总是抛出The payload is invalid..