src/Builders/RouteBuilderRegistry.php
private function applyGroupMiddleware(RouteBuilder $routeBuilder): void
    {
        $groupMiddlewareBindings = [];

        foreach ($this->groupOptionsStack as $groupOptions) {
            $groupMiddlewareBindings = \array_merge($groupMiddlewareBindings, $groupOptions->middlewareBindings);
        }

        $routeBuilder->withManyMiddleware($groupMiddlewareBindings);
    }
private function applyGroupMiddleware(RouteBuilder $routeBuilder): void
    {
        $groupMiddlewareBindings = [];

        foreach ($this->groupOptionsStack as $groupOptions) {
            $groupMiddlewareBindings = \array_merge($groupMiddlewareBindings, $groupOptions->middlewareBindings);
        }

        $routeBuilder->withManyMiddleware($groupMiddlewareBindings);
    }
Applies a group's middleware to the input route builder

@param RouteBuilder $routeBuilder The route builder to bind middleware to