carmelosantana / porkbun-sdk
A PHP library for interacting with the Porkbun API.
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.9
Requires (Dev)
- pestphp/pest: ^2.35
README
PHP library for interacting with the Porkbun API.
Supports
Interactions with Porkbun's API for;
- Domain management
- DNS record management
- SSL certificate retrieval
Features
- Manage domains: Update name servers, list domains, and more.
- Handle DNS records: Create, edit, retrieve, and delete DNS records.
- Manage SSL certificates: Retrieve SSL certificate bundles for your domains.
Install
Include PorkbunSdk
in your project with Composer:
composer require carmelosantana/porkbun-sdk
Requirements:
Usage
To use the Porkbun API, you need to have an API key and secret from Porkbun. You can obtain these by logging into your Porkbun account and generating an API key.
Domain
✅ Update the name servers for a domain.
$domain = new PorkbunSdk\Domain('your_api_key', 'your_secret_api_key'); $response = $domain->updateNameServers('example.com', [ 'ns1.example.com', 'ns2.example.com' ]); print_r($response);
DNS
✅ Create a new DNS A record for a domain.
$dns = new PorkbunSdk\DNS('your_api_key', 'your_secret_api_key'); $response = $dns->createRecord('example.com', 'A', '1.1.1.1', 'www'); print_r($response);
SSL
✅ Retrieve the SSL certificate bundle for a domain.
$ssl = new PorkbunSdk\SSL('your_api_key', 'your_secret_api_key'); $response = $ssl->getCertificate('example.com'); print_r($response);
Testing
To run the test suite:
composer test
Requirements:
- Pest is used for testing.
Support
Community support is available on Discord.
Funding
If you find this project useful or use it in a commercial environment, please consider donating:
- Bitcoin:
bc1qhxu9yf9g5jkazy6h4ux6c2apakfr90g2rkwu45
- Ethereum:
0x9f5D6dd018758891668BF2AC547D38515140460f
- Patreon: patreon.com/carmelosantana
- PayPal: Donate via PayPal
Changelog
- 1.0.0 - Aug 29, 2024
- Initial release of the
PorkbunSdk
library with support for Domain, DNS, and SSL management.
- Initial release of the
License
Code and documentation are released under the MIT License.