MiddlewareStack
final class MiddlewareStack (View source)
Maintains the ordered middleware class list used to build the global HTTP pipeline.
Methods
Initializes a mutable stack from middleware class names in execution order.
Appends middleware to the end of the execution order.
Prepends middleware to the beginning of the execution order.
Inserts middleware immediately before an existing target.
Inserts middleware immediately after an existing target.
Removes every occurrence of a middleware class while preserving remaining order.
Returns middleware class names in their current execution order.
Details
__construct
__construct(array $middlewares = [])
Initializes a mutable stack from middleware class names in execution order.
prepend
MiddlewareStack
prepend(string $middleware)
Prepends middleware to the beginning of the execution order.
insertBefore
MiddlewareStack
insertBefore(string $target, string $middleware)
Inserts middleware immediately before an existing target.
insertAfter
MiddlewareStack
insertAfter(string $target, string $middleware)
Inserts middleware immediately after an existing target.
remove
MiddlewareStack
remove(string $middleware)
Removes every occurrence of a middleware class while preserving remaining order.
all
array
all()
Returns middleware class names in their current execution order.