public function pushMiddleware($middlewares, $end = false)
    {
        $middlewares = (array) $middlewares;

        if ($end) {
            array_merge($this->middlewares, $middlewares);
        } else {
            array_merge($middlewares, $this->middlewares);
        }
    }
public function pushMiddleware($middlewares, $end = false)
    {
        $middlewares = (array) $middlewares;

        if ($end) {
            array_merge($this->middlewares, $middlewares);
        } else {
            array_merge($middlewares, $this->middlewares);
        }
    }
public function pushMiddleware ( $ middlewares , $ end = false ) { $ middlewares = ( array ) $ middlewares ; if ( $ end ) { array_merge ( $ this -> middlewares , $ middlewares ) ; } else { array_merge ( $ middlewares , $ this -> middlewares ) ; } }
Add a middleware to the list

@param array|callable $middlewares
@param bool $end
Add a middleware to the list