Skip to content

Commit 12d1514

Browse files
committed
Add middleware documentation
1 parent de5f355 commit 12d1514

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/middlewares.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# Middlewares
22

3+
Middlewares are an optional bit of logic to transform the given data at various lifecycle points.
4+
5+
### Path
6+
7+
To add a path middleware create a class that implements `\Vyuldashev\LaravelOpenApi\Contracts\PathMiddleware` then register it by referencing it in the `openapi.collections.default.middlewares.paths` config array like `MyPathMiddleware::class`
8+
9+
Available lifecycle points are:
10+
- `before` - after collecting all `RouteInformation` but before processing them.
11+
- `after` - after the `PathItem` has been built.

0 commit comments

Comments
 (0)