路由配置
路由是请求路径的配置入口,可通过 routes 进行配置。
- web 请求
Route::get('/','App\Http\Controllers\Index@index'); Route::get('/index.html','App\Http\Controllers\Index@index');
- api 请求
//常规路由 Route::prefix('login')->group(function () { Route::post('/check','App\Http\Controllers\Login@check'); }); //认证路由 Route::prefix('service')->middleware('auth')->group(function () { Route::get('/base','App\Http\Controllers\Service@base'); });