Surface connected domains in Ladill Domains' My Domains
Deploy Ladill Events / deploy (push) Successful in 55s
Deploy Ladill Events / deploy (push) Successful in 55s
Push the customer's connected domain to the central connected-domains registry so it appears under My Domains (with Transfer in if not registered with Ladill). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
75bb72abb3
commit
c3fa39a053
@@ -6,12 +6,16 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\CustomDomain;
|
||||
use App\Models\QrCode;
|
||||
use App\Services\CustomDomain\CustomDomainService;
|
||||
use App\Services\CustomDomain\DomainsSslClient;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CustomDomainController extends Controller
|
||||
{
|
||||
public function __construct(private readonly CustomDomainService $service) {}
|
||||
public function __construct(
|
||||
private readonly CustomDomainService $service,
|
||||
private readonly DomainsSslClient $domains,
|
||||
) {}
|
||||
|
||||
public function store(Request $request, QrCode $event): RedirectResponse
|
||||
{
|
||||
@@ -31,6 +35,14 @@ class CustomDomainController extends Controller
|
||||
|
||||
$this->service->attach($event, $host, (bool) ($data['include_www'] ?? true));
|
||||
|
||||
// Surface this domain in Ladill Domains' "My Domains" (best-effort).
|
||||
$this->domains->registerConnected(
|
||||
$host,
|
||||
(string) $request->user()->public_id,
|
||||
'Event: '.$event->label,
|
||||
route('events.show', $event),
|
||||
);
|
||||
|
||||
return back()->with('success', "Domain added. Point an A record for {$host} (and www) to ".config('customdomain.server_ip').', then click Verify.');
|
||||
}
|
||||
|
||||
@@ -47,7 +59,9 @@ class CustomDomainController extends Controller
|
||||
{
|
||||
$this->authorize('update', $customDomain->qrCode);
|
||||
|
||||
$host = $customDomain->host;
|
||||
$customDomain->delete();
|
||||
$this->domains->removeConnected($host);
|
||||
|
||||
return back()->with('success', 'Custom domain removed.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user