protected function moveMiddleware($middlewares, $from, $to)
    {
        array_splice($middlewares, $to, 0, $middlewares[$from]);

        unset($middlewares[$from + 1]);

        return $middlewares;
    }
protected function moveMiddleware($middlewares, $from, $to)
    {
        array_splice($middlewares, $to, 0, $middlewares[$from]);

        unset($middlewares[$from + 1]);

        return $middlewares;
    }
protected function moveMiddleware ( $ middlewares , $ from , $ to ) { array_splice ( $ middlewares , $ to , 0 , $ middlewares [ $ from ] ) ; unset ( $ middlewares [ $ from + 1 ] ) ; return $ middlewares ; }
Splice a middleware into a new position and remove the old entry.

@param  array  $middlewares
@param  int  $from
@param  int  $to
@return array
Splice a middleware into a new position and remove the old entry .