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.

Zone Lockdown

Zone Lockdown specifies a list of one or more IP addresses, CIDR ranges, or networks that are the only IPs allowed to access a domain, subdomain, or URL. You can configure multiple destinations, including IPv4/IPv6 addresses, in a single Zone Lockdown rule.

Cloudflare API docs

List

Fetches Zone Lockdown rules. You can filter the results using several optional parameters.

php
$response = $client->zones()->lockdowns()->list('zone_id');

Create

Creates a new Zone Lockdown rule.

php
$response = $client->zones()->lockdowns()->create('zone_id', '198.51.100.4');

Details

Fetches the details of a Zone Lockdown rule.

php
$response = $client->zones()->lockdowns()->details('zone_id', 'lockdown_id');

Update

Updates an existing Zone Lockdown rule.

php
$response = $client->zones()->lockdowns()->update('zone_id', 'lockdown_id', '198.51.100.4');

Delete

Deletes an existing Zone Lockdown rule.

php
$response = $client->zones()->lockdowns()->delete('zone_id', 'lockdown_id');