Domains
Cloudflare API docsList
Lists all Worker Domains for an account.
php
$response = $client->workers()->domains()->get('account_id');
Attach
Attaches a Worker to a zone and hostname.
php
$values = [
'environment' => 'production',
'hostname' => 'foo.example.com',
'service' => 'foo',
'zone_id' => '593c9c94de529bbbfaac7c53ced0447d',
];
$response = $client->workers()->domains()->attach('account_id', $values);
Detach
Detaches a Worker from a zone and hostname.
php
$response = $client->workers()->domains()->detach('account_id', 'domain_id');
Get
Gets a Worker domain.
php
$response = $client->workers()->domains()->domain('account_id', 'domain_id');