You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,18 @@ All middleware constructor options:
31
31
*`bool``$emmitToResponse` (default `true`) - if `true` request id will be added to response header
32
32
*`string``$headerName` (default `X-Request-Id`) - header name
33
33
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`.
0 commit comments