From 9b6f9f52c9ab7514cc218ef345c40bd3ccdee72c Mon Sep 17 00:00:00 2001 From: Yorda Date: Thu, 22 Aug 2024 16:36:14 -0600 Subject: [PATCH] updates method to domain identifier --- src/Repositories/UrlRepository.php | 2 +- src/Services/ClickService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Repositories/UrlRepository.php b/src/Repositories/UrlRepository.php index a991006..3a1912f 100644 --- a/src/Repositories/UrlRepository.php +++ b/src/Repositories/UrlRepository.php @@ -137,7 +137,7 @@ public static function findByIdentifier(string $identifier): ?ShortUrl )->with(self::defaultWithRelationship())->first(); } - public static function findByDomainIdentifier(?string $domain, string $identifier): ?ShortUrl + public static function findByDomainIdentifier(string $domain, string $identifier): ?ShortUrl { return ShortUrl::where('identifier', $identifier) ->where('domain', $domain) diff --git a/src/Services/ClickService.php b/src/Services/ClickService.php index 8a1a5f5..4e2b8bc 100644 --- a/src/Services/ClickService.php +++ b/src/Services/ClickService.php @@ -57,7 +57,7 @@ public static function track(string $identifier, string $request_ip, int $outcom try { ClickRepository::createClick( - UrlRepository::findByIdentifier($identifier, $domain)->id, + UrlRepository::findByDomainIdentifier($domain, $identifier)->id, LocationRepository::findOrCreateLocationRecord( ! config('location.testing.enabled') ? LocationRepository::getLocationFrom($request_ip)