public function setBaseUrl($url)
    {
        if (substr($url, -1) != '/') {
            $url .= '/';
        }

        if (substr($url,-4,4) != 'api/') {
            $url .= 'api/';
        }

        $this->baseUrl = $url;

        return $this;
    }
public function setBaseUrl($url)
    {
        if (substr($url, -1) != '/') {
            $url .= '/';
        }

        if (substr($url,-4,4) != 'api/') {
            $url .= 'api/';
        }

        $this->baseUrl = $url;

        return $this;
    }
public function setBaseUrl ( $ url ) { if ( substr ( $ url , - 1 ) != '/' ) { $ url .= '/' ; } if ( substr ( $ url , - 4 , 4 ) != 'api/' ) { $ url .= 'api/' ; } $ this -> baseUrl = $ url ; return $ this ; }
Set the base URL for API endpoints

@param string $url

@return $this
Set the base URL for API endpoints