league/uri
League URI provides simple, intuitive PHP 8.1+ classes to parse, validate, normalize, and manipulate URIs and related components. Supports PSR-7 interoperability, IDN hosts (intl/polyfill), IPv4 conversion, and HTML URI handling.
Feature Development:
例子.测试) via intl extension or polyfill, critical for global products.getPath() trims leading slashes)./users/{id} → /users/123).Roadmap Priorities:
fromWindowsPath(), fromUnixPath()) for hybrid deployments.Use Cases:
isSameOrigin(), isCrossOrigin()).UriTemplate::expand()) or normalize links.equals()/isSameDocument().Adopt When:
http://[2001:db8::1])./users/{id} → /users/42?filter={query}).Look Elsewhere If:
parse_url() or PHP 8.1’s native Uri::parse() for live parsing).League\Flysystem instead).ramsey/uuid for subsets of functionality).For Executives: *"This package lets us handle URLs/URIs like a first-class citizen—no more string hacks or regex nightmares. It’s battle-tested (used by Guzzle, Symfony), RFC-compliant, and future-proof (supports PHP 8.4+). For example:
For Engineers:
*"Why league/uri?
BackedEnum), PHP 8.4’s SensitiveParameter, and strict typing.Uri::new()->withPath('/new')->toString())./users/{id} with data).isIpv6Host(), isCrossOrigin()).Uri is limited; this package fills gaps (e.g., URN support, IDN, templates).
Migration Path: Drop-in replacement for parse_url()/http_build_url() in most cases."*How can I help you explore Laravel packages today?