private static function gatherMiddleware(IlluminateRoute $route)
    {
        /** @var  array  $middleware */
        $middleware = $route->middleware();

        return is_callable([$route, 'controllerMiddleware'])
            ? array_unique(array_merge($middleware, $route->controllerMiddleware()), SORT_REGULAR)
            : $middleware;
    }
private static function gatherMiddleware(IlluminateRoute $route)
    {
        /** @var  array  $middleware */
        $middleware = $route->middleware();

        return is_callable([$route, 'controllerMiddleware'])
            ? array_unique(array_merge($middleware, $route->controllerMiddleware()), SORT_REGULAR)
            : $middleware;
    }
private static function gatherMiddleware ( IlluminateRoute $ route ) { /** @var  array  $middleware */ $ middleware = $ route -> middleware ( ) ; return is_callable ( [ $ route , 'controllerMiddleware' ] ) ? array_unique ( array_merge ( $ middleware , $ route -> controllerMiddleware ( ) ) , SORT_REGULAR ) : $ middleware ; }
Gather all the route middleware.

@param  \Illuminate\Routing\Route  $route

@return array
Gather all the route middleware .