首页 > 解决方案 > 没有在 Laravel 5.2 中重定向登录页面

问题描述

我正在使用 laravel 5.2 并使用 auth 命令开发日志/注册系统和 Lartrust 管理面板。然后现在当我使用系统日志记录页面登录时没有移动到localhost:8000/home页面。它被重定向到另一个welcome.blade.php页面。如何将我的登录页面重定向到 localhost:8000/home 我的 routes.php 是

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

Route::auth();

Route::get('/home', 'HomeController@index')->name('home');

标签: phplaravel

解决方案


在您的登录控制器中将 redirectTo '/' 更改为 '/home';

class LoginController extends Controller
{


    use AuthenticatesUsers;
    protected $redirectTo = '/home';

}

推荐阅读