public function pushMiddleware(callable $middleware, string $name = null)
    {
        if (!is_null($name)) {
            $this->middlewares[$name] = $middleware;
        } else {
            array_push($this->middlewares, $middleware);
        }

        return $this;
    }
public function pushMiddleware(callable $middleware, string $name = null)
    {
        if (!is_null($name)) {
            $this->middlewares[$name] = $middleware;
        } else {
            array_push($this->middlewares, $middleware);
        }

        return $this;
    }
public function pushMiddleware ( callable $ middleware , string $ name = null ) { if ( ! is_null ( $ name ) ) { $ this -> middlewares [ $ name ] = $ middleware ; } else { array_push ( $ this -> middlewares , $ middleware ) ; } return $ this ; }
Add a middleware.

@param callable    $middleware
@param string|null $name

@return $this
Add a middleware .