protected function mergeMiddlewareGroup(array $action, $middleware = null)
    {
        if (isset($middleware)) {
            if (isset($action['middleware'])) {
                $action['middleware'] = array_merge($middleware, $action['middleware']);
            } else {
                $action['middleware'] = $middleware;
            }
        }

        return $action;
    }
protected function mergeMiddlewareGroup(array $action, $middleware = null)
    {
        if (isset($middleware)) {
            if (isset($action['middleware'])) {
                $action['middleware'] = array_merge($middleware, $action['middleware']);
            } else {
                $action['middleware'] = $middleware;
            }
        }

        return $action;
    }
protected function mergeMiddlewareGroup ( array $ action , $ middleware = null ) { if ( isset ( $ middleware ) ) { if ( isset ( $ action [ 'middleware' ] ) ) { $ action [ 'middleware' ] = array_merge ( $ middleware , $ action [ 'middleware' ] ) ; } else { $ action [ 'middleware' ] = $ middleware ; } } return $ action ; }
Merge the middleware group into the action.

@param  array  $action
@param  array  $middleware
@return array
Merge the middleware group into the action .