Wire Ladill domain picker and purchase modal into hosting flows.
Deploy Ladill Hosting / deploy (push) Successful in 51s

Use the Domains API for owned domains across panel, account, and order forms, with an embedded iframe purchase modal instead of redirecting to domains.ladill.com.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-19 18:01:23 +00:00
co-authored by Cursor
parent 44cfb1d9b9
commit 537e34cbd7
20 changed files with 532 additions and 306 deletions
@@ -0,0 +1,42 @@
<?php
namespace App\Services\Domains;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class LadillDomainsClient
{
/** @return list<string> */
public function ownedForUser(string $publicId): array
{
$key = (string) (config('domains.api_key') ?? '');
if ($key === '') {
return [];
}
try {
$res = Http::withToken($key)
->acceptJson()
->timeout(10)
->get(rtrim((string) config('domains.api_url'), '/').'/owned-domains', [
'user' => $publicId,
]);
$res->throw();
return collect($res->json('data', []))
->map(fn ($d) => strtolower(trim((string) $d)))
->filter()
->values()
->all();
} catch (\Throwable $e) {
Log::warning('LadillDomainsClient: could not load owned domains', [
'user' => $publicId,
'error' => $e->getMessage(),
]);
return [];
}
}
}