guzzlehttp/uri-template
RFC 6570 URI Template expansion for PHP. Build URLs by substituting variables into templates, handling reserved characters, query strings, and fragments. Lightweight Guzzle component installable via Composer, with tests and changelog included.
where('status', '=', $emptyVar)).?limit={$limit} where $limit = INF).Adopt if:
?{+filter} where filter = "").INF, NAN) in query parameters.?{&query} with array inputs).Look elsewhere if:
UrlGenerator).For Executives: *"This package resolves two critical gaps in our API and query infrastructure:
/users?{+filter}) work correctly even with empty variables or edge-case values like INF, reducing flaky integrations in [feature area, e.g., ‘partner APIs’ or ‘user dashboards’].For Engineering:
*"Why upgrade to guzzlehttp/uri-template v1.0.7?
?{+var} with var = "") now preserve the + operator, preventing broken query strings in dynamic filters.INF, NAN) no longer trigger warnings, cleaning up logs in numerical workflows (e.g., analytics, financial APIs).Action: If you’re using:
route('api.users', ['filter' => $input])),+, &, |),
test this update. No changes needed—just composer require guzzlehttp/uri-template. Focus on edge cases where variables might be empty or non-finite floats."*For Developers: *"Key improvements in v1.0.7:
?{+var} with var = "" now expands to ?+var= (previously ?var=), fixing broken query operators.INF/NAN in URLs (e.g., ?limit=INF).How to use:
use GuzzleHttp\UriTemplate;
// Expand a template
$template = new UriTemplate('/users?{+filter}');
$url = $template->expand(['filter' => '']); // Now: '/users?+filter='
When to care:
?filter= instead of ?+filter= in logs.INF/NAN in URLs.How can I help you explore Laravel packages today?