
Build it
1
Generate
Modules/DomainRegistrars/DomainSiloRegistrar with "category": "registrar", a provider extending RegistrarModuleServiceProvider, the thin service classes core looks up and a Services/Registrar.php stub.2
Implement Registrar
Fill in the methods that throw
not implemented yet. The class name and namespace are fixed, because RegistrarManager resolves Modules\{Module}\Services\Registrar.3
Enable and check
4
Set prices
Enter or import TLD prices on the domain pricing page in the admin, and pick a default registrar if you run more than one.
A small complete example
Rules that matter
Return data, never touch core tables
Return data, never touch core tables
A registrar module never writes to
services, invoices or domains. Return the data objects and let core save them.Throw RegistrarException only
Throw RegistrarException only
rejected() is final and not retried. connection($message, outcomeUnknown: true) means the request may have arrived. Core retries it but checks getInfo() first, so a domain is never ordered twice. Never retry a call that costs money inside the module.Declare what you support
Declare what you support
capabilities() lists App\Domains\Capability cases. Core hides buttons and skips calls for everything you leave out. Optional methods cover transfers, nameservers, lock, EPP code, ID protection, contacts, DNS records, email forwarding and TLD pricing.Domains are ASCII
Domains are ASCII
Domains arrive as punycode. Use
App\Domains\Data\DomainName, which knows multi label suffixes such as co.uk. Termination never deletes a domain at the registrar, it just stops renewing.Keep only connection details in the module
Keep only connection details in the module
Store API keys encrypted and list them under
secrets in module.json so the Secrets vault can see them. Default nameservers and prices are core settings.Http::fake(). NamecheapRegistrar and its Pest tests are the reference.
