league/uri-query-parser
A standalone PHP library for parsing and building RFC 3986 query strings. It preserves key order and duplicate parameters, handles configurable separators and encoding, and provides the query-string parsing foundation used by league/uri.
?b=2&a=1 and ?a=1&b=2 are the same resource — a direct input to CDN cache hit rates, deduplication of inbound links, and SEO canonicalization.?tag=a&tag=b vs ?tag[]=a&tag[]=b vs ?tag=a,b). This is a long-lived, versioned contract — expensive to change after GA.+ vs %20). This package is a cheap reference point for scoping either a 1-day internal utility or an adoption decision.Consider it when:
Look elsewhere when:
league/uri, whose QueryString component supersedes this package.Query::parse/Query::build), Symfony HttpFoundation, or PSR-7/PSR-17 infrastructure — you would be adding a dependency to duplicate an existing primitive.To executives: This is a tiny, free, MIT-licensed utility for reading and writing the ?a=1&b=2 part of a URL correctly — an unglamorous but load-bearing piece of plumbing behind cache hit rates, API contracts, and signature-based security. The cost is not money; it is ownership. The project was archived in 2019 and has no active maintainers, so adoption means we inherit it. Recommendation: use it as a design reference or a short-lived bridge, not a permanent dependency, and budget roughly one engineer-day to either vendor it or replace it with the equivalent already available in our framework or in league/uri. Low cost, low risk, and it de-risks a category of bugs that are painful to diagnose in production.
To engineering: It solves a real problem that parse_str does not — structured query values (repeated keys, comma/semicolon lists, bracket notation) with a builder that round-trips deterministically, which is exactly what you need for stable cache keys and signature base strings. The catch is that it is archived, so there are no upstream fixes and no PHP 8 certification. Proposal: a one-to-two day spike to (a) verify behavior against our real traffic samples, (b) confirm it runs clean on our target PHP version, and (c) compare against league/uri's QueryString and Guzzle's Query helpers. Exit with a build/buy/vendor recommendation rather than an open-ended dependency.
How can I help you explore Laravel packages today?