File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1212## Installation
1313
1414``` bash
15- composer require ' sunrise/http-router:^2.10 '
15+ composer require ' sunrise/http-router:^2.11 '
1616```
1717
1818## Support for OpenAPI (Swagger) Specification (optional)
@@ -208,6 +208,25 @@ $response = $router->handle($request);
208208$response = $router->process($request, $handler);
209209```
210210
211+ ``` php
212+ use Sunrise\Http\Router\Annotation as Mapping;
213+
214+ #[Mapping\Prefix('/api/v1')]
215+ #[Mapping\Middleware(SomeMiddleware::class)]
216+ class SomeController {
217+
218+ #[Mapping\Route('foo', path: '/foo')]
219+ public function foo() {
220+ // will be available at: /api/v1/foo
221+ }
222+
223+ #[Mapping\Route('bar', path: '/bar')]
224+ public function bar() {
225+ // will be available at: /api/v1/bar
226+ }
227+ }
228+ ```
229+
211230#### Without loading strategy
212231
213232``` php
You can’t perform that action at this time.
0 commit comments