Download the PHP package porkbun-php/client without Composer
On this page you can find all versions of the php package porkbun-php/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download porkbun-php/client
More information about porkbun-php/client
Files in porkbun-php/client
Package client
Short Description PHP client for the Porkbun API v3 with domain-centric design, typed DTOs, and complete endpoint coverage
License MIT
Homepage https://github.com/porkbun-php/client
Informations about the package client
Porkbun PHP API Client
A community-maintained PHP 8.4+ client for the Porkbun API v3 with complete endpoint coverage, domain-centric design, and Laravel integration.
Features
- Complete API coverage — all 27 Porkbun API v3 endpoints: DNS, DNSSEC, SSL, nameservers, URL forwarding, glue records, domains, pricing, and more
- Domain-centric design — fluent API:
$client->domain('example.com')->dns()->all() - Typed everything — immutable DTOs, backed enums, strict return types throughout
- Fluent builders — validated DNS record construction with convenience methods
- Structured errors — typed exception hierarchy with request/response context
- Laravel integration — service provider, facade, and config publishing out of the box
- PSR-18 compatible — works with any HTTP client (Guzzle, Symfony, curl, etc.)
- Strict quality — Pint, Pest, PHPStan, PHP 8.4+ with Rector
Requirements
- PHP 8.4+
- A PSR-18 HTTP client (Guzzle, Symfony HttpClient, or any other)
Installation
If you don't already have a PSR-18 HTTP client installed, add one:
[!TIP] Most frameworks already ship with a PSR-18 client — Laravel includes Guzzle, Symfony includes its HttpClient. The package auto-discovers it, so
new Porkbun\Client()just works.
Quick Start
Generate your API key and secret on the API Access page. To manage a specific domain via API, enable API Access for that domain in your Porkbun control panel.
Advanced configuration
API Reference
[!NOTE] All endpoints require authentication except Pricing — you can query TLD pricing without API keys.
Pricing (No Auth Required)
Ping (Auth Test)
Domains
Domain Details
Domain Availability
Domain Registration
DNS Records
[!TIP] Use the builder for validated record creation, or direct methods when you need to bypass client-side validation.
DNSSEC Records
Batch DNS Operations
SSL Certificates
Nameservers
URL Forwarding
Glue Records
Auto-Renewal
Error Handling
All exceptions implement Porkbun\Exception\ExceptionInterface for unified catching:
[!TIP] If the default endpoint is unreachable, fall back to
$client->useIpv4Endpoint(). See08-error-handling.phpfor the full pattern.
Laravel Integration
The package auto-registers via Laravel's package discovery. The service provider is deferred — the client is only instantiated when you use it.
Add credentials to .env:
Optionally publish the config:
Facade
Dependency Injection
Examples
See the examples/ directory for runnable scripts:
01-ping.php- Auth test and IPv4 endpoint switching02-pricing.php- Public pricing API, cheapest TLDs, iteration03-domains.php- List domains, pagination, expiring soon, availability check04-dns.php- DNS CRUD with direct methods, collection helpers05-dns-builder.php- Fluent builder, convenience methods, immutable templates06-dns-batch.php- Batch operations, mixed create/edit/delete07-domain-services.php- Nameservers, URL forwarding, glue records, SSL, auto-renew08-error-handling.php- Exception hierarchy, endpoint fallback pattern09-dynamic-dns.php- Real-world dynamic DNS updater recipe10-multi-account.php- Account switching, public/auth/clearAuth flow11-laravel.php- Facade usage, dependency injection, Artisan commands
Development
License
MIT License. See LICENSE for details.
All versions of client with dependencies
nyholm/psr7 Version ^1.8
php-http/discovery Version ^1.19
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0