Skip to content

Commit

Permalink
Improve Route::prependMiddleware() phpdoc (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Feb 20, 2025
1 parent 12f5183 commit eb6393f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,17 @@ public function middleware(array|callable|string ...$definition): self
}

/**
* Prepends a handler middleware definition that should be invoked for a matched route.
* Last added handler will be executed first.
* Prepends a handler middleware definition that should be invoked for a matched route. Last added handlers will be
* executed first.
*
* Passed definitions will be added to beginning. For example:
*
* ```php
* // Resulting middleware stack order: Middleware1, Middleware2, Middleware3
* Route::get('/')
* ->middleware(Middleware3::class)
* ->prependMiddleware(Middleware1::class, Middleware2::class)
* ```
*/
public function prependMiddleware(array|callable|string ...$definition): self
{
Expand Down

0 comments on commit eb6393f

Please sign in to comment.