jwage/purl
Purl is a lightweight, dependency-free PHP library for parsing and manipulating URLs. It provides a fluent object-oriented wrapper around parse_url, making it easy to inspect and modify schemes, hosts, paths, query strings, and fragments in your applications.
parse_url() that lets you compose, mutate, and re-serialize URLs (scheme, host, path, query params, fragments) instead of hand-rolling string concatenation. This directly informs the "write 40 lines of helper code vs. pull a dependency" decision for any feature that assembles URLs.league/uri, Guzzle's PSR-7 Uri, or Laravel's built-in Illuminate\Support\Uri — and whether that migration blocks an eventual PHP/framework upgrade.Consider it only when:
Look elsewhere when:
Illuminate\Support\Uri; the wider ecosystem offers league/uri (strict RFC 3986/3987, IDN, IPv6, URI templates) and guzzlehttp/psr7 (PSR-7 interop). These have active maintainers and security response.For executives: Purl is a small, permissively licensed (MIT) PHP utility for building and editing URLs as objects. It was well-regarded in its day (~900 GitHub stars) but is archived, with no release since April 2019, and targets PHP 7.2. The recommendation is not to adopt it for new work. Its value to us is as an audit item — we should confirm whether any of our services depend on it, size the replacement effort, and fold that into the platform modernization plan. Cost of standing still is low today; the risk is inherited, unmaintained code sitting in a security-sensitive path.
For engineering: Treat Purl as a legacy artifact. It's a friendly OO facade over parse_url() — good ergonomics, no strict RFC compliance, no PSR-7 interop, no active maintainer. Do not add it to new services. For anything currently using it, the drop-in targets are league/uri for standards-correct parsing and normalization, guzzlehttp/psr7 if we need UriInterface, or Laravel's Illuminate\Support\Uri if we want zero new dependencies. Please flag any existing usage so we can scope a migration off an archived package ahead of the next PHP upgrade.
How can I help you explore Laravel packages today?