简体   繁体   中英

how to make login page as first page laravel 8

i am trying to make the login page as a start page on laravel 8 i tried to delete welcome page to remplace it with login blade and get and i cant get any results

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

something like:

Route::get('/', function () {
    return view('auth.login');
});

and this is the middleware

Route::group(['prefix'=>'directeur','middleware'=>['isDirecteur','auth']], function(){
    Route::get('dashboard',[DirecteurController::class,'index'])->name('directeur.dashboard');
    Route::get('rapport',[DirecteurController::class,'rapport'])->name('directeur.rapport');
    Route::get('detail/{id}',[DirecteurController::class,'detail'])->name('directeur.details');
});

any suggestions??

first declare your route middleware, then use Route::view for rendering blade file. Based on docs

// Your middleware Route
...
//

Route::view('/', 'auth.login');

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