gpt4 book ai didi

laravel - fatal error : Class 'App\Http\Controllers\Redirect' not found

转载 作者:行者123 更新时间:2023-12-04 02:49:35 24 4
gpt4 key购买 nike

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

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\FatalThrowableError] Fatal error: Class 'App\Http\Controllers\Redirect' not found

最佳答案

您唯一需要做的就是添加:

use Redirect;

在您的 Controller 中 namespace 之后线或放 \在您调用之前 Redirect:: IE。:
return \Redirect::back();

关于laravel - fatal error : Class 'App\Http\Controllers\Redirect' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39892503/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com