Skip to content

Commit c168513

Browse files
committed
update readme
1 parent 33bc38e commit c168513

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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

0 commit comments

Comments
 (0)