src/Menu/Http/Controllers/Admin/MenuController.php
protected function prepareRoutes(Router $router)
    {
        $routeCollection = $router->getRoutes();
        $routes = [];

        /** @var Route $route */
        foreach ($routeCollection->getRoutes() as $route) {
            // We mecessarily need a GET Route with a Name
            // other routes are generally unsave to use with
            // the menu module
            if (in_array('GET', $route->methods())
                && $name = $route->getName()) {
                // Store the route in our prepared array
                $routes[$name] = $route->parameterNames();
            }
        }

        return $routes;
    }
protected function prepareRoutes(Router $router)
    {
        $routeCollection = $router->getRoutes();
        $routes = [];

        /** @var Route $route */
        foreach ($routeCollection->getRoutes() as $route) {
            // We mecessarily need a GET Route with a Name
            // other routes are generally unsave to use with
            // the menu module
            if (in_array('GET', $route->methods())
                && $name = $route->getName()) {
                // Store the route in our prepared array
                $routes[$name] = $route->parameterNames();
            }
        }

        return $routes;
    }
@param Router $router

@return array