php - Laravel make:auth 自定义文件夹
问题描述
我是使用 laravel 5.7 的新手。
我做了一个 make:auth 并进行身份验证,我需要使用http://localhost:8000/login,当我登录时,我被重定向到http://localhost:8000/home,但我想登录http://localhost: 8000/admin-panel/login当我进行身份验证时,我必须重定向到http://localhost:8000/admin-panel/home
我必须编辑哪些文件?
路线/web.php:
Route::get('/', function () { return view('welcome'); });
Auth::routes(['register' => false]);
Route::get('/home', 'HomeController@index')->name('home');
解决方案
路线/web.php
Route::group(['prefix' => 'admin-panel'], function(){
Route::get('/', function () { return view('welcome'); });
Auth::routes(['register' => false]);
Route::get('/home', 'HomeController@index')->name('home');
});
要查看您的所有路线,请将其放在项目根目录的命令行中
php artisan route:list
推荐阅读
- azure-devops - 我可以在不签入要掌握的 yaml 的情况下开发我的管道吗?
- javascript - 调用函数将引用错误作为函数未定义
- javascript - 如何检查从 ajax 调用返回的数据内容
- react-native - React Native 和 Mysql 连接
- flutter - 当 Flutter FutureProvider 解决它的未来时导航
- asp.net - .Net 重建后始终保留旧数据
- python - 平衡两个数据集进行训练
- twitter-bootstrap - 如何将引导页脚设置到页面末尾?
- spring-boot - 我如何在没有 STS 的情况下启动 jar 文件
- mysql - 将 mysql 中的 TIME 数据类型限制为仅保留到 24:00:00 小时