当我在我的终端中运行下面的命令时,它显示下面的代码,而不是路由

php artisan route:list



 <html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="1;url=http://localhost/login" />

        <title>Redirecting to http://localhost/login</title>
    </head>
    <body>
        Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
    </body>
</html>

[Symfony\Component\Debug\Exception\fatalthrowayerror]致命

推荐答案

如果任何路由及其相关控制器出现错误,则无法运行php artisan route:list.

In this case, it looks like you have a controller that has an error which is that you're using the Redirect facade without importing it first, so it's looking for the Redirect class in the same namespace as the controller, i.e. App\Http\Controllers\Redirect.

Locate the class that is using the Redirect facade and add Use Redirect to the top of the file and that should sort it hopefully!

Laravel相关问答推荐

使用Laravel判断其他数据库中是否存在记录

将错误消息抛出并显示为关联数组

Laravel Eloquent:组合列(或自定义属性)上的 Where 子句

从主类别模型 laravel 中获取子类别翻译

Laravel Debugbar 中的 Laravel api routes路由

如何在laravel中输出奇偶行

Laravel:子文件夹中的 lang 文件

Laravel 6 Passport 在错误的凭证上返回 400 Bad request

覆盖 HTTP 标头的默认设置 (X-FRAME-OPTIONS)

实施 Payum/Laravel 定期付款

Homestead 2.0 多个站点,都链接到同一个 url

SQLSTATE [HY000]:一般错误:1005 无法创建表 - Laravel 4

Twilio 查找 API 不起作用?

使用数据库用户提供程序时如何在 Laravel 中创建密码重置方法

当表中不存在列时如何将 paginate() 与 having() 子句一起使用

Laravel:命令未找到

Laravel 迁移 - 删除列

在 Laravel 中结合 AND/OR Eloquent的查询

如何在 Eloquent Orm 中实现自引用(parent_id)模型

使用 Laravel Mix 合并多个文件