简体   繁体   中英

Laravel make:auth custom folder

I'm new to using laravel 5.7.

I made a make:auth and to authenticate I need use http://localhost:8000/login and when I login I get redirected to http://localhost:8000/home , but I want login on http://localhost:8000/admin-panel/login and when I auth, I have to redirect to http://localhost:8000/admin-panel/home

Which files I will have to edit?

routes/web.php:

Route::get('/', function () { return view('welcome'); }); 
Auth::routes(['register' => false]);
Route::get('/home', 'HomeController@index')->name('home');

routes/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');  
});

to see all your routes put this in the command line at your project root

php artisan route:list

I think your intention is use prefix on route group.

Route::prefix('/admin-panel')->namespace('admin-panel')->group(function()
{                                     
 Route::get('/dashboard', 'AdminController@AdminDashboard')->name('dashboard');
});

After this your route behave like this

 Route::get('/admin-pannel/dashboard', 'admin-pannel/AdminController@AdminDashboard')->name('dashboard');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM