Note: This library is under active development as I expand it to cover Cloudflare API. Consider the public API of this package a little unstable as I work towards a v1.0. See Coverage.

Domains

Cloudflare API docs

List

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');
Table of Contents