src/Kernel/App.php
public function pipe(Middleware $middleware, string $alias = ''): App
    {
        $alias = $alias ? $alias : $middleware->alias();
        if (isset($this->pipe[$alias])) {
            throw new SimplesAlreadyRegisteredError("The middleware `{$alias}` is already registered");
        }
        $this->pipe[$alias] = $middleware;

        return $this;
    }
public function pipe(Middleware $middleware, string $alias = ''): App
    {
        $alias = $alias ? $alias : $middleware->alias();
        if (isset($this->pipe[$alias])) {
            throw new SimplesAlreadyRegisteredError("The middleware `{$alias}` is already registered");
        }
        $this->pipe[$alias] = $middleware;

        return $this;
    }
public function pipe ( Middleware $ middleware , string $ alias = '' ) : App { $ alias = $ alias ? $ alias : $ middleware -> alias ( ) ; if ( isset ( $ this -> pipe [ $ alias ] ) ) { throw new SimplesAlreadyRegisteredError ( "The middleware `{$alias}` is already registered" ) ; } $ this -> pipe [ $ alias ] = $ middleware ; return $ this ; }
Add middleware's to pipe

@param Middleware $middleware
@param string $alias
@return App
@throws SimplesAlreadyRegisteredError
Add middleware s to pipe