更新时间:2023-02-17 10:00:32
由您调用
http://localhost:8080/api/test
^^^
如果您查看 app/Providers/RouteServiceProvider.php
您会看到默认情况下它为 API 路由设置了 api
前缀,如果您愿意,当然可以更改.
If you look in app/Providers/RouteServiceProvider.php
you'd see that by default it sets the api
prefix for API routes, which you can change of course if you want to.
protected function mapApiRoutes()
{
Route::group([
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
});
}