layershifter/tld-support
Lightweight PHP utilities for parsing domains and top-level domains. Split URLs into subdomain, domain, and TLD, validate hostnames, and work with public suffix data. A small dependency for the tld-extract ecosystem, useful for domain validation, sorting, and extraction tasks.
example.co.uk rather than co.uk (a common, serious bug class).acme.app.com from app.com for tenant resolution and wildcard SSL coverage.www., blog., shop. don't fragment dashboards.github.io and s3.amazonaws.com), any PSL-backed capability is a recurring maintenance commitment, not a one-time integration. That belongs in roadmap capacity planning, not just a ticket.Consider it only if all of the following hold:
Look elsewhere if any of the following are true — and for most teams at least one is:
.app, .dev, .zip, and most private-section entries) will be mis-parsed. In cookie scoping or tenant routing this is a correctness bug, not a cosmetic one.jeremykendall/php-domain-parser / the pdp lineage) with a bundled or cacheable PSL, or calling TLDExtract directly behind your own small interface, both dominate this package on every axis except "already wired for Laravel."DomainParser::parse($host): RegistrableDomain behind your own contract, the vendor choice becomes reversible — which is the strongest argument for not adopting an archived wrapper in the first place.Read the 0.2 score plainly: low opportunity, zero dependents, archived. This is a candidate for a "do not adopt" line in your dependency policy, not a bake-off entrant.
For executives (30 seconds): We evaluated a small open-source helper that lets our Laravel app correctly identify the "real" domain behind a hostname — the thing that stops us from setting a cookie on an entire country domain, or from lumping every customer's subdomain into one analytics bucket. The capability matters; this specific package doesn't. It was last released in 2016, is archived, has no downstream users, and its underlying domain data is roughly a decade stale. Recommendation: don't adopt. Fund a one-day engineering task to put the same capability behind our own interface using a maintained library. Cost is trivial; the risk we avoid is a silent correctness bug in cookies, tenants, or per-domain limits.
For engineering (the actual ask):
.app, .dev, .zip, and private suffixes.DomainParser as our own contract; implement with a maintained PSL parser that ships or caches a current list; register it in our own provider (~50 LOC). Pin the PSL refresh to a scheduled job so staleness is a monitored signal rather than a surprise.composer.json.The one-line framing to reuse: the requirement is real and cheap to satisfy; this package is stale glue, so we'll own the glue and rent the data.
How can I help you explore Laravel packages today?