Laravel 5.5:seeder中的route()函数返回错误的路由(localhost / not localhost:8000 /)

问题描述 投票:0回答:1

在我的播种机中我有这个:

'route' => route('home') // should return http://localhost:8000

然而,它返回http://localhost

我只在我的播种机中遇到这个问题。在其他地方使用route('home')将返回http://localhost:8000。如何在播种机中找到正确的路线?我发现几年前发布的question相同,尽管它对Laravel 5.5不起作用。在此先感谢您的帮助!

php laravel
1个回答
1
投票

尝试更改.env文件中的以下行:APP_URL=http://localhostAPP_URL=http://localhost:8000然后运行php artisan config:cache以防万一

© www.soinside.com 2019 - 2024. All rights reserved.