spatie/laravel-rdap
Laravel package for performing RDAP lookups (WHOIS successor) to fetch domain registration data as structured JSON. Includes built-in caching for TLD server discovery and RDAP responses, plus configurable retries/timeouts for unreliable endpoints.
Rdap::domain(), Rdap::ip()) for querying RDAP endpoints, aligning well with Laravel’s service container and facade patterns. This reduces boilerplate for HTTP clients, caching, and retries.DomainResponse, IpResponse) with methods like get(), hasStatus(), and date-specific accessors, making integration with Laravel’s Eloquent or DTOs seamless.tld_servers_cache) and domain/IP responses (via allnetru's PR) reduces external API calls and improves performance.RdapRequestTimedOut, InvalidRdapResponse) allow for graceful degradation or retry logic in the application layer.cache() helper) and Carbon for date handling.dnsServer parameter, enabling use cases like internal RDAP mocking for testing.retry_times), but applications must handle null responses or exceptions gracefully.Http::fake() or a local RDAP server (e.g., RDAP Mock Server).guzzlehttp/guzzle is used internally but abstracted).spatie/laravel-package-tools (for publishing config), carbon/carbon (for dates).Http::fake() for unit tests.composer require spatie/laravel-rdap
php artisan vendor:publish --tag="rdap-config"
Rdap facade. No manual binding required.Rdap::domain('example.com')) in a single service/class.file_get_contents() + JSON parsing) with the package’s methods.Rdap::ip('1.2.3.4') similarly.DomainResponse/IpResponse classes if additional properties/methods are needed..com, RIPE for EU IPs).file, redis, database). Ensure the configured driver supports the tld_servers_cache duration.DomainLookupService).RdapException and null responses.tld_servers_cache and test cache hit/miss ratios.retry_times and timeout_in_seconds in config. Use Rdap::domainIsSupported() to verify TLD/IP coverage.php artisan cache:clear) or adjust store_name in config if using a custom driver.InvalidRdapResponse by validating the raw response structure (see test stubs).file driver for tld_servers_cache.How can I help you explore Laravel packages today?