laravel 5.1:在 AuthController 中重定向不起作用(使用 xampp)

laravel 5.1: redirecting in AuthController doesn't work (using xampp)

我正在使用 laravel 5.1,我正在努力让用户能够登录我的应用程序。我在 xampp 中执行此操作,因此我的登录路径如下所示:http://localhost/laravel/public/index.php/auth/login

但是,当我尝试登录时,它会将我重定向到 http://localhost/auth/login and gives a 404 error. It does this too when the login fails. I have tried to set the 'protected $redirectPath' and 'protected $loginPath' in the AuthController to something like localhost/laravel/public/index.php/ to get to the home page, but it doesn't work and still goes to http://localhost/auth/login。我将非常感谢任何可以帮助我或向我解释如何在登录或登录失败后进行重定向的人。

刚刚解决了我自己的问题:事实证明我将我的登录表单发布到 /auth/login(我刚刚从 laravel 文档中复制了示例),所以我将其更改为 /laravel/public/index.php/auth/login 现在一切都恢复正常了!

最好用

php artisan serve 

在你的项目路线中,如果你在本地主机上开发,因为你可以更容易地控制你的路线,你可以摆脱 localhost/laravel/public/index.php/ .