Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Url Builder Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on URL plumbing. Nearly every product surface eventually needs "take a URL, change one part, hand it back": appending UTM/campaign parameters, swapping subdomains for multi-tenant routing, prefixing locale segments, rewriting pagination links, or normalizing callback/webhook URLs. This package is a candidate for that thin utility layer, so the decision it informs is whether to own ~200 lines of URL logic or inherit a dependency.
  • Feature scoping for marketing/analytics work. If a roadmap item is "generate trackable share links" or "deep-link into the app from email," a fluent builder (withQuery, withHost, withScheme, rebuild) turns a fiddly string-concatenation task into a half-day ticket instead of a multi-day one.
  • Redirect and link safety. Parsing then explicitly reconstructing a URL (rather than string-splicing user input) is the safer pattern for open-redirect protection, allowlisting hosts, and stripping unexpected params before issuing a 302.
  • Cache-key and canonicalization strategy. Merging/deduping/sorting query params is a recurring requirement for CDN cache keys and canonical tag generation; this is a decision point on whether to standardize that behavior in one internal helper.
  • Dependency policy precedent. With 1 star, 0 dependents, and a last release in March 2023, adopting this sets a precedent for what the team considers an acceptable third-party footprint — a governance decision as much as a technical one.

When to Consider This Package

Consider it when:

  • You need fluent mutation of an already-parsed URL (add/remove/replace individual query params, swap host or scheme, then rebuild) and want to avoid hand-rolling that with parse_url + http_build_query, which loses duplicate keys and mishandles some edge cases.
  • The scope is small and internal — CLI tools, seeders, admin panels, one-off import/export scripts — where a forkable MIT snippet is preferable to a heavier abstraction.
  • Your team is comfortable vendoring or forking it and writing your own test suite around it, treating it as a starting implementation rather than a supported product.
  • You only need absolute-URL manipulation, not relative-reference resolution.

Look elsewhere when:

  • You need standards coverage: RFC 3986/3987 normalization, IDN/punycode, IPv6 literals, relative reference resolution, or strict component validation. Use league/uri.
  • You want immutable PSR-7 URIs that interoperate with HTTP clients and middleware. Use guzzlehttp/psr7 or nyholm/psr7.
  • You are inside Laravel and just need to generate URLs — UrlGenerator, url(), route(), and Request::fullUrlWithQuery() already cover the majority of cases with zero new dependencies.
  • You require long-term support, security patching, or a contributor base large enough to survive maintainer burnout. Zero dependents and a stale release mean you are effectively the maintainer the day you adopt it.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core