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

Php Domain Parser Laravel Package

jeremykendall/php-domain-parser

Parse, validate, and normalize domains, subdomains, and suffixes using the Public Suffix List. Extract registrable domain vs. subdomain, handle IDNs and edge cases, and keep parsing rules current via PSL updates—ideal for URL processing, cookies, and security checks.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development: Enables accurate domain parsing for features like:
    • User registration/validation (e.g., detecting valid TLDs, subdomains, or public suffixes).
    • Email validation (e.g., extracting domains from email addresses for spam checks or analytics).
    • URL normalization (e.g., stripping subdomains or public suffixes for canonicalization).
    • Geographic targeting (e.g., identifying country-code TLDs for localized content or ads).
  • Roadmap Prioritization:
    • Accelerates compliance-heavy features (e.g., GDPR cookie consent by domain scope).
    • Reduces technical debt by outsourcing domain logic to a battle-tested package.
  • Build vs. Buy:
    • Buy: Avoid reinventing the wheel for domain parsing (especially for edge cases like co.uk or xn-- IDNs).
    • Build: Only if the project requires custom domain rules beyond public suffixes (e.g., internal naming conventions).
  • Use Cases:
    • Security: Detecting malicious domains (e.g., phishing or typosquatting).
    • Analytics: Segmenting traffic by domain type (e.g., .com vs. .gov).
    • APIs: Validating custom domains for SaaS products (e.g., *.customer.yourservice.com).

When to Consider This Package

  • Adopt if:
    • Your app handles user-provided domains (e.g., registration, email, or URL inputs).
    • You need RFC 6761-compliant public suffix parsing (e.g., for accurate subdomain extraction).
    • Your team lacks domain parsing expertise or time to maintain a custom solution.
    • You’re using PHP/Laravel and want to avoid JavaScript dependencies (e.g., tld.js).
    • Compliance or edge-case handling (e.g., example.co.uk, xn--bcher-kva.ch) is critical.
  • Look elsewhere if:
    • You need IDN (Internationalized Domain Name) validation beyond basic Unicode support (consider rubix/ml-idn).
    • Your use case requires deep DNS analysis (e.g., WHOIS lookups; use a dedicated DNS library).
    • You’re in a non-PHP ecosystem (e.g., Python: publicsuffixlist; Node.js: tldjs).
    • You need real-time domain availability checks (e.g., WHOIS; use a dedicated API).

How to Pitch It (Stakeholders)

For Executives: *"This package lets us handle domain parsing—like validating emails, detecting phishing risks, or enabling custom domains for our SaaS—without building or maintaining the complex logic ourselves. It’s used by 1,200+ projects, MIT-licensed, and updated regularly. For example, we could use it to:

  • Reduce fraud by flagging suspicious domains in user signups.
  • Improve UX by auto-detecting country-specific TLDs for localized onboarding.
  • Cut costs by avoiding custom development for a niche but critical feature. It’s a low-risk, high-reward decision with minimal ongoing effort."*

For Engineering: *"This is a drop-in PHP package that solves domain parsing with:

  • Public Suffix List (PSL) compliance (handles co.uk, xn-- domains, etc.).
  • Zero dependencies beyond PHP (works seamlessly with Laravel).
  • Active maintenance (last updated 2025). Use cases:
  • Replace regex hacks for domain validation.
  • Extract subdomains/public suffixes for analytics or security rules.
  • Integrate with Laravel’s Str::of() or custom validation logic. Trade-offs:
  • No DNS resolution (just parsing).
  • MIT license is permissive but not open-core (if that’s a concern). Proposal: Add to composer.json and use DomainParser::parse() in validation layers or middleware."*
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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui