Push middlewares

@param array $middlewares
978820
public function pushMiddleware(array $middlewares)
    {
        foreach ($middlewares as $key => $middleware) {
            $this->middlewares[$key] = $middleware;
        }
    }
1150440
public function pushMiddlewareToGroup( $group, $middleware )
	{
		if ( isset( $this->middlewareGroups[$group] ) && !in_array( $middleware, $this->middlewareGroups[$group] ) )
		{
			$this->middlewareGroups[$group][] = $middleware;
		}

		return $this;
	}
758058
public function pipes(array $middlewares): App
    {
        foreach ($middlewares as $key => $middleware) {
            if (is_numeric($key)) {
                $this->pipe($middleware);
                continue;
            }
            $this->pipe($middleware, $key);
        }
        return $this;
    }
254981
public function setMiddleware($middleware) : self
    {
        if (is_string($middleware)) {
            $middleware = [$middleware];
        }
        $this->middleware = collect()->merge($middleware);
        return $this;
    }
316108
protected function pushMiddleware($middleware, $force = false)
    {
        if (PHP_SAPI !== 'cli' && $force === false && $this->app->runningUnitTests() === false) {
            return $this->getHttpKernel();
        }

        $this->getHttpKernel()->pushMiddleware($middleware);
    }
211971
private function chainMiddleware(array $middleware): callable
    {
        $middleware = array_reverse($middleware);

        return array_reduce($middleware, function (callable $next, MiddlewareInterface $middleware): callable {
            return function (View $view) use ($middleware, $next): View {
                return $middleware->process($view, $this->request, $next);
            };
        }, function (View $view): View {
            $view->render();

            return $view;
        });
    }
21773
protected function addMiddlewareGroups($middlewareGroups)
    {
        if (is_array($middlewareGroups) && (count($middlewareGroups) > 0)) {
            foreach ($middlewareGroups as $key => $groupMiddleware) {
                foreach ($groupMiddleware as $middleware) {
                    $this->pushMiddlewareToGroup($key, $middleware);
                }
            }
        }
    }
897373
public function middleware($middleware = null)
    {
        if (is_null($middleware)) {
            return (array) ($this->action['middleware'] ?? []);
        }

        if (is_string($middleware)) {
            $middleware = func_get_args();
        }

        $this->action['middleware'] = array_merge(
            (array) ($this->action['middleware'] ?? []), $middleware
        );

        return $this;
    }
852365
public function add($middleware)
        {
            if (!is_string($middleware) && !$middleware instanceof MiddlewareInterface) {
                throw new \InvalidArgumentException('Middleware must be a string or an instance of MiddlewareInterface');
            }

            $class = is_string($middleware) ? new $middleware : $middleware;
            array_push($this->middleware, $class);
        }
589409
public function addMiddleware($middleware, bool $prepend = false)
    {
        if (!is_array($middleware)) {
            $middleware = [$middleware];
        }

        if ($prepend) {
            $this->middleware = array_merge($middleware, $this->middleware);
        } else {
            $this->middleware = array_merge($this->middleware, $middleware);
        }

        $this->middleware = array_unique($this->middleware, SORT_REGULAR);
    }
256316
public static function addMiddleware($middleware)
    {
        $kernelFile = self::read();
        if (!str_contains($kernelFile, $middleware)) {
            $kernelFile = self::insertBetween($kernelFile, 'protected $middleware = [', "]", $middleware);
            self::save($kernelFile);
        }
    }
419286
public static function addStaticMiddlewares(...$middlewares): array
    {
        $stack = static::getStaticMiddlewareStack(true);
        foreach ($middlewares as $middleware) {
            $stack->append($middleware);
        }
        return $middlewares;
    }
141124
protected function addRouteMiddleware($routeMiddleware)
    {
        if (is_array($routeMiddleware) && (count($routeMiddleware) > 0)) {
            foreach ($routeMiddleware as $key => $middleware) {
                $this->middleware($key, $middleware);
            }
        }
    }
136487
public function addGroup(string $name, string $prefix = '', array $middlewares = [])
    {
        $this->groups[$name] = [$prefix, $middlewares];
    }
148767
public function pushMiddleware($middleware)
    {
        if (array_search($middleware, $this->middleware) === false) {
            array_push($this->middleware, $middleware);
        }

        return $this;
    }
1115895
protected function moveMiddleware($middlewares, $from, $to)
    {
        array_splice($middlewares, $to, 0, $middlewares[$from]);

        unset($middlewares[$from + 1]);

        return $middlewares;
    }
721246
public function prependMiddleware($middleware)
    {
        if (array_search($middleware, $this->middleware) === false) {
            array_unshift($this->middleware, $middleware);
        }

        return $this;
    }