Methods |
public
static
|
getInstance()
Static method to provide access to the single instance
Static method to provide access to the single instance
|
#
|
public
|
register(Closure $closure, string $event = self::BEFORE): $this
Register a middleware
Parameters
$closure |
Anonymous function
|
$event |
before or after
|
|
#
|
public
|
on(string $key, string $value): $this
Register route filter for the middleware
Register route filter for the middleware
Parameters
$key |
One of the values - startWith, contain, equal, except
|
$value |
URI or a part of URI
|
|
#
|
public
|
order(int $sort, string $event = self::BEFORE): $this
Register precedence of the middleware
Register precedence of the middleware
Parameters
$sort |
Ascending order (smaller value runs first)
|
$event |
before (default) or after
|
|
#
|
public
static
|
runBefore()
Run all registered middlewares (before)
Run all registered middlewares (before)
|
#
|
public
static
|
runAfter()
Run all registered middlewares (after)
Run all registered middlewares (after)
|
#
|