ash-jc-allen / short-url

A Laravel package for creating shortened URLs for your web apps.
MIT License
1.24k stars 156 forks source link

Prefix in config is not being used to generate link #111

Closed yusifk88 closed 2 years ago

yusifk88 commented 2 years ago

The source code here is different from what composer requires which comes with a hardcoded prefix(short) and would not apply the prefix set in the config file. This makes it impossible to change the prefix via config

protected function insertShortURLIntoDatabase(): ShortURL { return ShortURL::create([ 'destination_url' => $this->destinationUrl, 'default_short_url' => config('app.url').'/short/'.$this->urlKey, 'url_key' => $this->urlKey, 'single_use' => $this->singleUse, 'track_visits' => $this->trackVisits, 'redirect_status_code' => $this->redirectStatusCode, 'track_ip_address' => $this->trackIPAddress, 'track_operating_system' => $this->trackOperatingSystem, 'track_operating_system_version' => $this->trackOperatingSystemVersion, 'track_browser' => $this->trackBrowser, 'track_browser_version' => $this->trackBrowserVersion, 'track_referer_url' => $this->trackRefererURL, 'track_device_type' => $this->trackDeviceType, 'activated_at' => $this->activateAt, 'deactivated_at' => $this->deactivateAt, ]); }

ash-jc-allen commented 2 years ago

Hi @yusifk88,

Sorry that you're having issues with the package. What version of it are you using? v6.1.0 onwards gives you the ability to change the prefix (https://github.com/ash-jc-allen/short-url/blob/v6.1.0/src/Classes/Builder.php) :)

yusifk88 commented 2 years ago

^5.2

On Wed, Dec 15, 2021, 4:51 PM Ash Allen @.***> wrote:

Hi @yusifk88 https://github.com/yusifk88,

Sorry that you're having issues with the package. What version of it are you using? v6.1.0 onwards gives you the ability to change the prefix ( https://github.com/ash-jc-allen/short-url/blob/v6.1.0/src/Classes/Builder.php) :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ash-jc-allen/short-url/issues/111#issuecomment-994975719, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVPMVTELCES5XKMQ4Y7RODURDBSVANCNFSM5KECNOOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ash-jc-allen commented 2 years ago

Ahh okay, in that case, you'll need to update the package in your application to at least v6.1.0 to use the customisable prefix :)

yusifk88 commented 2 years ago

Okay, the issue here is composer can't detect that even for an update but I will manual update it

On Wed, Dec 15, 2021, 4:57 PM Ash Allen @.***> wrote:

Ahh okay, in that case, you'll need to update the package in your application to at least v6.1.0 to use the customisable prefix :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ash-jc-allen/short-url/issues/111#issuecomment-994980158, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVPMVW5RSPY5SFPKGNUJT3URDCF7ANCNFSM5KECNOOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

yusifk88 commented 2 years ago

Sure thanks

On Wed, Dec 15, 2021, 4:59 PM Katulie Yusif @.***> wrote:

Okay, the issue here is composer can't detect that even for an update but I will manual update it

On Wed, Dec 15, 2021, 4:57 PM Ash Allen @.***> wrote:

Ahh okay, in that case, you'll need to update the package in your application to at least v6.1.0 to use the customisable prefix :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/ash-jc-allen/short-url/issues/111#issuecomment-994980158 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKVPMVW5RSPY5SFPKGNUJT3URDCF7ANCNFSM5KECNOOA

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ash-jc-allen/short-url/issues/111#issuecomment-994981785, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVPMVTXHISPEXXZPDZ6SEDURDCNJANCNFSM5KECNOOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.