protected function getMiddleware($instance, $action)
    {
        $results = array();
        $middleware = (array) $instance->getOption('middleware');
        foreach ($middleware as $class => $options) {
            if ((!isset($options['only']) || in_array($action, (array) $options['only'])) &&
                (!isset($options['except']) || !in_array($action, (array) $options['except']))
            ) {
                $results[$class] = $options;
            }
        }

        return $results;
    }
protected function getMiddleware($instance, $action)
    {
        $results = array();
        $middleware = (array) $instance->getOption('middleware');
        foreach ($middleware as $class => $options) {
            if ((!isset($options['only']) || in_array($action, (array) $options['only'])) &&
                (!isset($options['except']) || !in_array($action, (array) $options['except']))
            ) {
                $results[$class] = $options;
            }
        }

        return $results;
    }
protected function getMiddleware ( $ instance , $ action ) { $ results = array ( ) ; $ middleware = ( array ) $ instance -> getOption ( 'middleware' ) ; foreach ( $ middleware as $ class => $ options ) { if ( ( ! isset ( $ options [ 'only' ] ) || in_array ( $ action , ( array ) $ options [ 'only' ] ) ) && ( ! isset ( $ options [ 'except' ] ) || ! in_array ( $ action , ( array ) $ options [ 'except' ] ) ) ) { $ results [ $ class ] = $ options ; } } return $ results ; }
Returns middleware for specified action

@param \Wei\BaseController $instance
@param string $action
@return array
Returns middleware for specified action