src/Viserio/Component/Routing/ResourceRegistrar.php
protected function getResourcePrefix(string $name): array
    {
        $segments = \explode('/', $name);

        // To get the prefix, we will take all of the name segments and implode them on
        // a slash. This will generate a proper URI prefix for us. Then we take this
        // last segment, which will be considered the final resources name we use.
        $prefix = \implode('/', \array_slice($segments, 0, -1));

        return [\end($segments), $prefix];
    }
protected function getResourcePrefix(string $name): array
    {
        $segments = \explode('/', $name);

        // To get the prefix, we will take all of the name segments and implode them on
        // a slash. This will generate a proper URI prefix for us. Then we take this
        // last segment, which will be considered the final resources name we use.
        $prefix = \implode('/', \array_slice($segments, 0, -1));

        return [\end($segments), $prefix];
    }
Extract the resource and prefix from a resource name.

@param string $name

@return array