Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Commit b039aa5

Browse files
author
Niek Brekelmans
committed
default ttl
1 parent 72eb6b1 commit b039aa5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

config/hetzner-dns.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
// config for DutchCodingCompany/HetznerDnsClient
33
return [
44
'api_token' => env('HETZNER_DNS_API_TOKEN'),
5+
'default_ttl' => env('HETZNER_DNS_DEFAULT_TTL', 300),
56
];

src/Requests/Zones/CreateZone.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ class CreateZone extends SaloonRequest
1717
public function __construct(
1818
protected string $name,
1919
protected ?int $ttl = null,
20-
)
21-
{}
20+
){
21+
$this->ttl ??= config('hetzner-dns.default_ttl');
22+
}
2223

2324
protected ?string $connector = HetznerDnsClient::class;
2425

src/Requests/Zones/UpdateZone.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ public function __construct(
2020

2121
protected string $name,
2222
protected ?int $ttl = null,
23-
)
24-
{}
23+
) {
24+
$this->ttl ??= config('hetzner-dns.default_ttl');
25+
}
2526

2627
protected ?string $connector = HetznerDnsClient::class;
2728

0 commit comments

Comments
 (0)