Skip to content

Commit bf41724

Browse files
committed
Update README.md
1 parent c8b1f5a commit bf41724

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ All middleware constructor options:
3131
* `bool` `$emmitToResponse` (default `true`) - if `true` request id will be added to response header
3232
* `string` `$headerName` (default `X-Request-Id`) - header name
3333

34+
## Request Id generators
35+
36+
To generate request id you need to use implementation of `PhpMiddleware\RequestId\Generator\GeneratorInterface`. There are predefined generators in `PhpMiddleware\RequestId\Generator\` namespace:
37+
38+
### `PhpUniqidGenerator`
39+
40+
Simple generator using [uniqid](http://php.net/manual/en/function.uniqid.php) function.
41+
42+
### `RhumsaaUuid4Generator`
43+
44+
[UUID](https://tools.ietf.org/html/rfc4122)4 implementations of [Rhumsaa\Uuid](https://github.com/ramsey/uuid). To use it you need to add `ramsey/uuid` dependency to your `composer.json`.
45+
3446
## It's just works with any modern php framework!
3547

3648
Middleware tested on:

0 commit comments

Comments
 (0)