1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-20 11:03:01 +08:00
2019-12-13 00:10:10 +08:00

41 lines
725 B
PHP

<?php
namespace App\Http\Api\Controllers;
/**
* @RoutePrefix("/api")
*/
class IndexController extends Controller
{
/**
* @Get("/", name="api.index")
*/
public function indexAction()
{
}
/**
* @Get("/routes", name="api.routes")
*/
public function routesAction()
{
$definitions = [];
$routes = $this->router->getRoutes();
foreach ($routes as $route) {
if (strpos($route->getPattern(), '/api') !== false) {
$definitions[] = [
'pattern' => $route->getPattern(),
'methods' => $route->getHttpMethods(),
];
}
}
dd($definitions);
}
}