php - 没有在 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');
解决方案
在您的登录控制器中将 redirectTo '/' 更改为 '/home';
class LoginController extends Controller
{
use AuthenticatesUsers;
protected $redirectTo = '/home';
}
推荐阅读
- node.js - 在 Node.js 的 typescript 类成员函数中访问响应对象
- angular - formgroupname 在 ngfor 中具有相同的索引
- python - 将标准差函数转换为 numpy 形式
- android - Android:theme.xml 文件中的值覆盖 drawable 中的 gradient_file.xml
- python - Scrapy 返回“Last Modified”日期错误:“KeyError: 'last-modified'”/“ValueError: year 1610477971 is out of range”
- multithreading - 为长时间运行的函数构建进度视图
- javascript - 如何仅显示背景图像的一部分:线性渐变?
- reactjs - 如何解决 setState 在 React 中不更新?
- c# - 如何在 Entity Framework Core (Oracle) 中使用用户定义的函数?
- java - Java枚举给出不正确的值