We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66006da commit a10ae58Copy full SHA for a10ae58
app/Http/Controllers/Api/V1/SiteController.php
@@ -48,9 +48,11 @@ public function register(SiteRequest $request): JsonResponse
48
return $this->error($e->getMessage(), 500);
49
}
50
51
- // If successful create or update site
52
- $site = Site::where('url', $url)->where('key', $key)->first() ?? new Site();
+ // Remove older duplicates of the site if registered
+ Site::query()->where('url', $url)->delete();
53
54
+ // Create new row
55
+ $site = new Site();
56
$site->key = $key;
57
$site->url = $url;
58
$site->last_seen = Carbon::now();
0 commit comments