protected function matchRequest(Request $request, array $parameters = [])
    {
        if (!isset($parameters['_modular_path'])) {
            throw new \InvalidArgumentException('The routing provider expected parameter "_modular_path" but could not find it.');
        }

        // Grab the first segment from the remaining path
        $path = $parameters['_modular_path'];
        $position = strpos($path, '/');

        return $position ? substr($path, 0, $position) : $path;
    }