public function uploadImage($image) { if (!is_null($image)) { $result = $this->uploader->uploadFile($image); $longUrl = $result['url']; //initialize bitly $this->initBitly(); //shorten url $this->shortUrl = $this->shortener->shortenUrl($longUrl); } }
/** * Shorten the file url * @param string $longUrl * @return string the shortened url */ public function shortenUrl($longUrl) { return $this->shortener->shortenUrl($longUrl); }