XF_Index/routes/web.php

47 lines
1.5 KiB
PHP
Raw Normal View History

2023-06-10 14:21:40 +08:00
<?php
/*
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
* 开发开源遵循 MIT 许可,若需商用请联系开发者
* https://www.x-lf.com/
*/
2023-06-12 16:12:20 +08:00
use App\Http\Controllers\Console\Dashboard;
use App\Http\Controllers\Console\Index;
2023-06-11 14:20:56 +08:00
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Response;
2023-06-10 14:21:40 +08:00
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', [Index::class,'ViewIndex'])->name('home');
2023-06-11 14:20:56 +08:00
Route::prefix('console')->middleware('auth')->group(function () {
2023-06-12 16:12:20 +08:00
Route::get('dashboard', [Dashboard::class,'ViewDashboard'])->name('console.dashboard');
2023-06-11 14:20:56 +08:00
});
Route::prefix('auth')->group(function () {
Route::redirect('','auth/login');
Route::get('login', function () {
return view('auth.login');
})->name('login');
Route::get('register',function () {
return view('auth.register');
})->name('register');
Route::get('forgotpassword',function () {
return view('auth.forgotpassword');
})->name('forgotpassword');
Route::match(['get','post'],'logout',function () {
Auth::logout();
return Response::redirectTo('');
})->name('logout');
2023-06-10 14:21:40 +08:00
});