Commit
This commit is contained in:
parent
b643c9834d
commit
ecd318498f
@ -60,12 +60,14 @@ abstract class Route {
|
|||||||
$middlewares = [$middlewares];
|
$middlewares = [$middlewares];
|
||||||
}
|
}
|
||||||
foreach ($middlewares as $middleware) {
|
foreach ($middlewares as $middleware) {
|
||||||
self::$groups[(count(self::$groups) - 1)][] = $middleware;
|
array_push(
|
||||||
|
self::$groups[array_key_last(self::$groups)], $middleware
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static function group(callable $callback) {
|
static function group(callable $callback) {
|
||||||
self::$groups[] = [];
|
array_push(self::$groups, []);
|
||||||
$callback();
|
$callback();
|
||||||
array_pop(self::$groups);
|
array_pop(self::$groups);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user