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

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

jakeasmith/http_build_url provides a pure-PHP implementation of http_build_url(), the URL-manipulation helper normally supplied by the pecl_http extension. It is a drop-in Composer replacement for projects that need to parse, merge, and rebuild URLs without requiring the extension, including Laravel and other PHP applications.

  • Drop-in http_build_url() function with matching signature and flags
  • Parse and rebuild absolute, relative, and partial URLs
  • Merge paths and queries using HTTP_URL_* constants
  • No extension dependencies; install via Composer
  • Useful for canonical URLs, redirects, and request URL handling
Frequently asked questions about Http Build Url
Is jakeasmith/http_build_url deprecated?
Yes. The package is archived, and its own description tells users to use PHP 8.5's built-in Uri\Rfc3986\Uri instead. The last release was in 2017, so new adoption should be avoided except as a temporary compatibility shim.
Does jakeasmith/http_build_url work with Laravel?
It can be installed in any Laravel version because it is a framework-agnostic Composer package that autoloads a single global function. It has no service provider, facade, config, or container binding, so there is nothing Laravel-specific to configure. However, Laravel 11+ ships Illuminate\Support\Uri, which is usually the better choice for new code.
How do I install jakeasmith/http_build_url?
Install it with composer require jakeasmith/http_build_url. There is no configuration step and no transitive dependency chain. Composer's files autoload defines http_build_url() unless the function already exists, for example when pecl_http is loaded.
What should I use instead of http_build_url() in Laravel?
For application URLs, use route() or url(). For programmatic composition and relative resolution, use Illuminate\Support\Uri in Laravel 11+, GuzzleHttp\Psr7\Uri with UriResolver, or league/uri. Pick the replacement that preserves the exact flag behavior your call sites rely on.
Does jakeasmith/http_build_url support PHP 8.5?
PHP 8.5 introduces the built-in Uri\Rfc3986\Uri class, which is the migration target named by the package's deprecation notice. The polyfill predates PHP 8 and its Composer PHP constraint does not declare support for modern runtimes, though it may still install and run. On PHP 8.5+, prefer the native URI class over this package.
Is jakeasmith/http_build_url safe to use in production?
The code performs pure in-memory string manipulation with no I/O, network calls, or deserialization, so the exploit surface is small. The larger production risk is abandonment: no fixes for edge cases such as IPv6 literals, userinfo, default-port normalization, or percent-encoding. Many SCA and policy tools block archived packages, so expect a governance exception if you keep it.
Does jakeasmith/http_build_url conflict with pecl_http?
It guards its function definition with function_exists(), so it should not cause a fatal redeclare when pecl_http is present. In that case the polyfill becomes a no-op and behavior shifts to the extension's implementation. Test both environments if you rely on specific flag semantics.
Does jakeasmith/http_build_url handle relative URLs and URL joining?
Yes, it supports relative URL resolution, path and query joining, and component overrides using flags such as HTTP_URL_REPLACE, JOIN_PATH, JOIN_QUERY, and STRIP_*. It approximates pecl_http semantics but is not guaranteed to be bit-identical. Encode your expected outputs as tests, especially for path normalization and query merging.
Is jakeasmith/http_build_url a Laravel package?
No. It is a single global function delivered through Composer's files autoload, not a Laravel package. It has no service provider, facade, configuration file, or container binding, so it sits outside Laravel's architecture. That makes it maximally compatible but also minimally idiomatic in a Laravel codebase.
How do I migrate away from jakeasmith/http_build_url?
Inventory every http_build_url() call site and any vendor package that requires it, then classify which flags each one uses. Abstract URL composition behind a first-party UriBuilder or UrlComposer service so application code stops calling the global function. Map the pecl_http flags to Illuminate\Support\Uri, PSR-7, or league/uri operations and encode parity in tests before swapping implementations.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource