src/Model/Project.php
public static function getProjectBaseFromUrl($url)
    {
        if (preg_match('#/api/projects/([^/]+)#', $url, $matches)) {
            return uri_for($url)->withPath('/api/projects/' . $matches[1])->__toString();
        }

        throw new \RuntimeException('Failed to find project ID from URL: ' . $url);
    }
public static function getProjectBaseFromUrl($url)
    {
        if (preg_match('#/api/projects/([^/]+)#', $url, $matches)) {
            return uri_for($url)->withPath('/api/projects/' . $matches[1])->__toString();
        }

        throw new \RuntimeException('Failed to find project ID from URL: ' . $url);
    }
public static function getProjectBaseFromUrl ( $ url ) { if ( preg_match ( '#/api/projects/([^/]+)#' , $ url , $ matches ) ) { return uri_for ( $ url ) -> withPath ( '/api/projects/' . $ matches [ 1 ] ) -> __toString ( ) ; } throw new \ RuntimeException ( 'Failed to find project ID from URL: ' . $ url ) ; }
Find the project base URL from another project resource's URL.

@param string $url

@return string
Find the project base URL from another project resource s URL .