首页 > 解决方案 > 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');

标签: phplaravellaravel-5.7

解决方案


路线/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

推荐阅读