-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdomains.php
More file actions
61 lines (50 loc) · 1.26 KB
/
domains.php
File metadata and controls
61 lines (50 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php declare(strict_types=1);
/**
* Domain management examples.
*
* See: https://www.hostfact.nl/developer/api/domein/
*/
use Hyperized\Hostfact\Api\Controllers\Domain;
// List all domains
$domains = Domain::new()->list([]);
// Show domain details
$domain = Domain::new()->show([
'DomainCode' => 'DM0001',
]);
// Register a new domain
$registered = Domain::new()->register([
'Domain' => 'example.nl',
'DebtorCode' => 'DB0001',
'HandleCode' => 'HN0001',
]);
// Transfer a domain
$transferred = Domain::new()->transfer([
'Domain' => 'example.nl',
'DebtorCode' => 'DB0001',
'AuthCode' => 'abc123',
]);
// Edit nameservers
$ns = Domain::new()->changeNameserver([
'DomainCode' => 'DM0001',
'Nameserver1' => 'ns1.example.nl',
'Nameserver2' => 'ns2.example.nl',
]);
// Get DNS zone
$dns = Domain::new()->getDnsZone([
'DomainCode' => 'DM0001',
]);
// Edit DNS zone
$updated = Domain::new()->editDnsZone([
'DomainCode' => 'DM0001',
'DNSZone' => [
['Name' => '@', 'Type' => 'A', 'Content' => '1.2.3.4', 'TTL' => '3600'],
],
]);
// Lock a domain
$locked = Domain::new()->lock([
'DomainCode' => 'DM0001',
]);
// Check domain availability
$available = Domain::new()->check([
'Domain' => 'example.nl',
]);