src/Utils/Path.php
public static final function getRelativePath($absolutePath)
    {
        if (!is_string($absolutePath)) {
            throw new InvalidPathException();
        }

        $pattern = array(self::getRootPath(), DIRECTORY_SEPARATOR, '//');
        $replacement = array('', '/', '/');

        $raltivePath = str_replace($pattern, $replacement, $absolutePath);

        if(substr($raltivePath, 0, 1) != '/') {
            $raltivePath = '/' . $raltivePath;
        }
        
        return str_replace('/public', '', $raltivePath);
    }
public static final function getRelativePath($absolutePath)
    {
        if (!is_string($absolutePath)) {
            throw new InvalidPathException();
        }

        $pattern = array(self::getRootPath(), DIRECTORY_SEPARATOR, '//');
        $replacement = array('', '/', '/');

        $raltivePath = str_replace($pattern, $replacement, $absolutePath);

        if(substr($raltivePath, 0, 1) != '/') {
            $raltivePath = '/' . $raltivePath;
        }
        
        return str_replace('/public', '', $raltivePath);
    }
Returns relative path of the absolute path. When you pass $absolutePath='/var/www/vegas/config'  then the result
should be '/config'

@param string $absolutePath
@throws InvalidPathException
@return mixed|string