Wire Ladill domain picker and purchase modal into servers flows.
Deploy Ladill Servers / deploy (push) Successful in 27s
Deploy Ladill Servers / deploy (push) Successful in 27s
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:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Services\Domains\LadillDomainsClient;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class OwnedDomainsController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request, LadillDomainsClient $domains): JsonResponse
|
||||
{
|
||||
$exclude = collect($request->query('exclude', []))
|
||||
->map(fn ($d) => strtolower(trim((string) $d)))
|
||||
->filter()
|
||||
->all();
|
||||
|
||||
$owned = collect($domains->ownedForUser((string) ladill_account()->public_id))
|
||||
->reject(fn ($d) => in_array($d, $exclude, true))
|
||||
->sort()
|
||||
->values()
|
||||
->all();
|
||||
|
||||
return response()->json(['data' => $owned]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user