🆙 Add fixed cms 🆙

This commit is contained in:
Remco
2026-02-02 19:30:21 +01:00
parent b1a2cab62d
commit b67e0ec2b9
3982 changed files with 193682 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
namespace App\Services;
use Illuminate\Support\Facades\Http;
class IpLookupService
{
private string $baseUrl = 'https://api.ipdata.co';
public function __construct(private readonly string $apiKey) {}
public function ipLookup(string $ip)
{
$response = Http::acceptJson()->get(sprintf('%s/%s?api-key=%s', $this->baseUrl, $ip, $this->apiKey));
if (! $response->ok()) {
$message = array_key_exists('message', $response->json()) ? $response->json()['message'] : 'Unknown error';
return [
'message' => $message,
'status' => $response->status(),
];
}
return $response->json();
}
}