https://www.www.com/api/users?api_version=...
Route::group([
'namespace' => 'api',
'prefix' => 'api',
], function () {
Route::get('users', 'UserController@index');
});
Route::group([
'namespace' => 'api',
'prefix' => request()->get('api_version') >= 1.1 ? 'api' : 'xxxxxx',
], function () {
Route::get('users', 'UserController@index1.1');
});
Route::group([
'namespace' => 'api',
'prefix' => request()->get('api_version') >= 2.1 ? 'api' : 'xxxxxx',
], function () {
Route::get('users', 'UserController@index2.1');
});
本作品採用《CC 協議》,轉載必須註明作者和本文連結