This PHP/Laravel client around the Hetzner DNS API support:
- Zones
- Records
This SDK is based on Saloon, a Laravel / PHP package that helps write API integrations and SDKs.
You can install the package via composer:
composer require dutchcodingcompany/laravel-hetzner-dns-api
Set your hetzner dns api token in your .env file:
HETZNER_DNS_API_TOKEN=hetzner-dns-token-here
You can publish the config file with:
php artisan vendor:publish --tag="hetzner-dns-api-config"
This is the contents of the published config file can be found here.
If you would like to store the API Token outside of the config (e.g. encrypted in the database), you can override the resolver in the boot
method of the AppServiceProvider
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use DutchCodingCompany\HetznerDnsClient\HetznerDnsClient;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
HetznerDnsClient::resolveApiTokenUsing(fn () => 'your-token');
}
}
$records = HetznerDnsClient::records()->all();
// resolves to a Records DTO
- add caching
- ...
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.