Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Rdap Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Domain/IP Query Abstraction: The package provides a clean, facade-based interface (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.
  • Structured Response Handling: Returns typed responses (DomainResponse, IpResponse) with methods like get(), hasStatus(), and date-specific accessors, making integration with Laravel’s Eloquent or DTOs seamless.
  • Caching Layer: Built-in caching for TLD servers (configurable via tld_servers_cache) and domain/IP responses (via allnetru's PR) reduces external API calls and improves performance.
  • Error Handling: Explicit exceptions (RdapRequestTimedOut, InvalidRdapResponse) allow for graceful degradation or retry logic in the application layer.

Integration Feasibility

  • Laravel Ecosystem Compatibility: Designed for Laravel (10–13.x), with no external dependencies beyond PHP’s core and Laravel’s HTTP client. Works with Laravel’s caching (cache() helper) and Carbon for date handling.
  • Extensibility: Supports custom RDAP servers (e.g., private registries) via the dnsServer parameter, enabling use cases like internal RDAP mocking for testing.
  • Domain/IP Dual Support: Unified API for both domains and IPs, reducing code duplication for similar use cases (e.g., fraud detection, compliance checks).

Technical Risk

  • RDAP Server Reliability: RDAP endpoints are less standardized than WHOIS, with variable response times and unsupported TLDs/IP ranges. The package mitigates this with retries (configurable via retry_times), but applications must handle null responses or exceptions gracefully.
  • Caching Complexity: While caching improves performance, invalidation strategies (e.g., TTL updates for TLD servers) must be monitored. Misconfiguration could lead to stale data.
  • IPv6 Support: Limited testing/validation for IPv6 queries (per changelog, IPv4/IPv6 registries are separate but not deeply documented). Requires validation if IPv6 is a priority.
  • Laravel Version Lock: Latest release supports Laravel 13.x, but older versions (e.g., 9.x) may require backporting or forks. Check compatibility if using LTS versions.

Key Questions

  1. Use Case Scope:
    • Are queries limited to public RDAP endpoints, or will custom/private servers be used? If the latter, how will credentials or authentication be handled?
    • What’s the expected query volume? High traffic may require distributed caching (e.g., Redis) or rate-limiting.
  2. Data Sensitivity:
    • Does the application need to log or audit RDAP responses? The package doesn’t include logging by default.
    • Are there compliance requirements (e.g., GDPR) for handling registration data? Responses may include PII (e.g., registrant names).
  3. Fallback Mechanisms:
    • How should the app handle unsupported TLDs/IPs or failed queries? Fallback to WHOIS or manual data entry?
  4. Testing Strategy:
    • Will tests mock RDAP responses? The package lacks built-in test doubles; consider using Http::fake() or a local RDAP server (e.g., RDAP Mock Server).
  5. Performance:
    • Are there plans to cache responses beyond the default (e.g., Redis)? The package uses Laravel’s cache, which may not scale for high-throughput systems.

Integration Approach

Stack Fit

  • Laravel-Centric: Optimized for Laravel’s service container, facades, and HTTP client. No conflicts with existing Laravel packages (e.g., guzzlehttp/guzzle is used internally but abstracted).
  • PHP Version: Requires PHP 8.1+ (per Laravel 10+ compatibility). No major version constraints beyond Laravel’s support matrix.
  • Dependencies:
    • Core: spatie/laravel-package-tools (for publishing config), carbon/carbon (for dates).
    • External: Relies on Laravel’s HTTP client and cache drivers. No database requirements.
  • Testing: Uses Pest/PHPUnit. Existing tests can be extended with Http::fake() for unit tests.

Migration Path

  1. Installation:
    composer require spatie/laravel-rdap
    php artisan vendor:publish --tag="rdap-config"
    
    • Publish the config to adjust caching/retry settings.
  2. Facade Registration:
    • The package auto-registers the Rdap facade. No manual binding required.
  3. Incremental Adoption:
    • Start with domain queries (e.g., Rdap::domain('example.com')) in a single service/class.
    • Gradually replace manual RDAP logic (e.g., file_get_contents() + JSON parsing) with the package’s methods.
    • For IP queries, use Rdap::ip('1.2.3.4') similarly.
  4. Customization:
    • Override default retry logic or TLD servers via config or method parameters.
    • Extend DomainResponse/IpResponse classes if additional properties/methods are needed.

Compatibility

  • Laravel Versions: Officially supports 10–13.x. For older versions, check the 1.1.1 changelog for backporting needs.
  • PHP Extensions: None required beyond Laravel’s defaults.
  • RDAP Server Compatibility: Works with any RDAP-compliant endpoint. Test with target registries (e.g., Verisign for .com, RIPE for EU IPs).
  • Caching Backends: Uses Laravel’s cache drivers (e.g., file, redis, database). Ensure the configured driver supports the tld_servers_cache duration.

Sequencing

  1. Phase 1: Core Integration
    • Implement domain/IP queries in a dedicated service (e.g., DomainLookupService).
    • Add error handling for RdapException and null responses.
  2. Phase 2: Caching Optimization
    • Configure tld_servers_cache and test cache hit/miss ratios.
    • Extend caching for domain/IP responses if needed (e.g., via middleware or event listeners).
  3. Phase 3: Advanced Use Cases
    • Add custom RDAP servers for private registries.
    • Implement logging/auditing for sensitive queries.
  4. Phase 4: Monitoring
    • Track RDAP response times and retry rates (e.g., with Laravel Telescope or Prometheus).
    • Set up alerts for failed queries or unsupported TLDs/IPs.

Operational Impact

Maintenance

  • Package Updates: Spatie maintains active development (last release: 2026-06-29). Monitor the changelog for breaking changes (e.g., PHP 8.4 deprecations in 1.1.2).
  • Configuration Drift: The published config file is minimal. Changes to retries/caching can be version-controlled.
  • Dependency Risks: Limited to Laravel/core PHP packages. No third-party libraries with complex dependencies.

Support

  • Troubleshooting:
    • Failed Queries: Check retry_times and timeout_in_seconds in config. Use Rdap::domainIsSupported() to verify TLD/IP coverage.
    • Caching Issues: Clear cache (php artisan cache:clear) or adjust store_name in config if using a custom driver.
    • Invalid Responses: Handle InvalidRdapResponse by validating the raw response structure (see test stubs).
  • Community: Spatie’s packages have strong community support (72 stars, active PRs). Issues are resolved promptly (e.g., #49 for custom servers).
  • Documentation: README and method signatures are clear. For advanced use cases (e.g., custom servers), refer to the source code.

Scaling

  • Horizontal Scaling:
    • Stateless queries (no shared state beyond caching). Can scale horizontally with Laravel’s queue workers or microservices.
    • Distribute caching (e.g., Redis) if using file driver for tld_servers_cache.
  • Performance Bottlenecks:
    • RDAP Latency: External API calls are the primary bottleneck. Mitigate with:
      • Aggressive caching (e.g., 24h TTL for
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata