public function getMiddlewareForMethod($method)
    {
        $middleware = [];

        foreach ($this->middleware as $name => $options) {
            if (isset($options['only']) && ! \in_array($method, (array) $options['only'])) {
                continue;
            }

            if (isset($options['except']) && \in_array($method, (array) $options['except'])) {
                continue;
            }

            $middleware[] = $name;
        }

        return $middleware;
    }
public function getMiddlewareForMethod($method)
    {
        $middleware = [];

        foreach ($this->middleware as $name => $options) {
            if (isset($options['only']) && ! \in_array($method, (array) $options['only'])) {
                continue;
            }

            if (isset($options['except']) && \in_array($method, (array) $options['except'])) {
                continue;
            }

            $middleware[] = $name;
        }

        return $middleware;
    }
public function getMiddlewareForMethod ( $ method ) { $ middleware = [ ] ; foreach ( $ this -> middleware as $ name => $ options ) { if ( isset ( $ options [ 'only' ] ) && ! \ in_array ( $ method , ( array ) $ options [ 'only' ] ) ) { continue ; } if ( isset ( $ options [ 'except' ] ) && \ in_array ( $ method , ( array ) $ options [ 'except' ] ) ) { continue ; } $ middleware [ ] = $ name ; } return $ middleware ; }
Get the middleware for a given method.

@param  string  $method

@return array
Get the middleware for a given method .