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

Http Build Url Laravel Package

jakeasmith/http_build_url

Pure-PHP drop-in for the PECL HTTP extension's http_build_url(). Parse URLs into components and reassemble them reliably, handling schemes, hosts, paths, query strings, and fragments. Ideal for merging parameters or rebuilding relative URLs without needing the extension installed.

Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for URL handling. The scope here is one function (http_build_url()) — assembling and reassembling URLs from parts, the inverse of parse_url(). That's too small to justify an internal library and too fiddly to hand-roll correctly (port/userinfo/fragment edge cases, RFC 3986 relative resolution). This package settles that decision for a few lines of Composer config.
  • OAuth/OIDC and SSO redirect URI assembly. Redirect and callback URIs must be byte-exact or providers reject them. A single, tested composition primitive removes a class of "works in staging, fails in prod" defects caused by hand-concatenated query strings.
  • Webhook and integration callback generation. Any feature that emits a URL to a third party (webhooks, SAML ACS endpoints, deep links, magic-link emails) depends on correct encoding of query params and fragments.
  • Canonical URL and SEO/share-surface correctness. Canonical tags, sitemaps, og:url, and share-preview URLs need deterministic normalization (scheme/host casing, default-port stripping, sorted query params). This is the primitive those pipelines sit on.
  • Multi-tenant and subdomain routing. Building per-tenant URLs by swapping host/scheme while preserving path and query is exactly the HTTP_URL_REPLACE use case.
  • Dependency-governance and tech-debt roadmap decisions. The package's own status — archived, last release May 2017, superseded by PHP 8.5's native Uri\Rfc3986\Uri — makes it a useful forcing function for a decision most teams defer: what is our policy on archived transitive dependencies, and when do we schedule their removal?
  • Platform-version planning. Adoption is explicitly a bridge to PHP 8.5. Choosing it (or not) is a signal about when you intend to be on 8.5, which touches upgrade budgeting, security-patch cadence, and hosting constraints.

When to Consider This Package

Adopt when all of these hold:

Criterion Why it matters here
You are on PHP < 8.5 The native replacement doesn't exist yet; something has to fill the gap.
pecl_http is unavailable That's the package's entire reason for existing — it's a pure-PHP polyfill.
URL composition appears in a bounded number of call sites Low call-site count means the eventual swap is a mechanical, low-risk change.
You don't need a full URI abstraction No PSR-7/PSR-17 interop, no IDN, no validation pipeline — just composition.
You can verify it runs on your PHP version Last release was 2017; the code is trivial string manipulation, but "archived" means nobody has certified 8.2/8.3/8.4. Gate adoption on your test suite, not the badge.
Security review accepts an archived dependency The blast radius is genuinely small: one pure function, no I/O, no deserialization, no network calls. Document that reasoning — it's the defensible exception to a "no archived deps" rule.

Look elsewhere when any of these hold:

  • PHP 8.5+. Use Uri\Rfc3986\Uri directly. Adopting this package on 8.5 is pure technical debt with zero offsetting benefit.
  • You need parsing, validation, resolution, or normalization, not just composition. Reach for league/uri — actively maintained, RFC-compliant, handles IDN and reference resolution. Don't stretch a one-function shim into a URI layer.
  • You're already standardizing on PSR-7/PSR-17. Use your existing URI factory; a second, parallel URL-construction path is how inconsistent encoding bugs get born.
  • Your dependency policy forbids archived packages, or SOC 2 / vendor-review processes require a maintained upstream with a security contact. Reasonable — just recognize you're paying for a bigger library to satisfy a policy, not to get better URL composition.
  • You need a maintained security response channel. Archived means no CVE triage. Again: near-zero exploit surface here, but that's a risk you accept explicitly rather than assume away.
  • You need IDN/punycode, or strict RFC 3986 reference resolution. Out of scope for this package.

How to Pitch It (Stakeholders)

For executives (30 seconds): We need reliable URL construction for [OAuth callbacks / webhook delivery / canonical links]. The options are: hand-roll it (cheap to write, expensive to debug), adopt a full URI library (more capability than we need, more surface to maintain), or install a tiny MIT-licensed utility that does exactly one thing. I recommend the third: it's a one-line dependency with no transitive packages, no runtime services, and no data handling — so the security exposure is effectively nil. The caveat you should hear plainly: it is archived and has had no release since 2017, and PHP 8.5 ships this functionality natively. That makes it a deliberate, time-boxed bridge, not a permanent foundation. I'm asking for a small migration ticket now, so it's a planned cleanup rather than an audit finding later.

For engineering: One function, MIT, zero dependencies, wrap it behind our own UrlBuilder interface on day one so call sites never touch the package symbol directly. Verify against our PHP matrix before merge. Swapping to Uri\Rfc3986\Uri at 8.5 becomes a single-file change, and the wrapper is where we'd put normalization rules anyway. Do not extend it into a URI abstraction — if requirements grow past composition, we switch to league/uri rather than build on this.

The honest headline: this is a low-cost unblocker with a known expiry date. Approve it with the migration scheduled, not the migration deferred.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings