codezero/php-url-builder
A lightweight PHP library for building and manipulating URLs programmatically. Compose paths, query strings, and parameters with a simple API, making it easier to generate consistent, readable links in Laravel or any PHP project.
withQuery, withHost, withScheme, rebuild) turns a fiddly string-concatenation task into a half-day ticket instead of a multi-day one.Consider it when:
parse_url + http_build_query, which loses duplicate keys and mishandles some edge cases.Look elsewhere when:
league/uri.guzzlehttp/psr7 or nyholm/psr7.UrlGenerator, url(), route(), and Request::fullUrlWithQuery() already cover the majority of cases with zero new dependencies.To executives: This is a tiny, MIT-licensed helper for editing URLs in code. Integration cost is near zero and there is no commercial or licensing exposure. The counterweight is equally clear: essentially no community validation and no releases since early 2023, so it should not be positioned as a strategic dependency or a reason to defer anything on the roadmap. Treat it as a reference design we can absorb in an afternoon, not a platform bet.
To engineering: It does one narrow job — parse, mutate, rebuild — and does it in a readable way, which makes it a good pattern to copy. My recommendation is to adopt the approach rather than the package: either vendor the handful of methods we need behind an internal UrlMutator interface, or standardize on league/uri if we need real RFC compliance. Either path keeps a known-maintainer dependency boundary and lets us test the behavior we actually rely on. If we do pull it in, pin the version, wrap it, and add our own contract tests on day one.
How can I help you explore Laravel packages today?