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
Uri Template

Uri Template Laravel Package

gdbots/uri-template

A PHP implementation of URI templates (RFC 6570) for expanding and matching parameterized URI patterns. Build and parse templates with simple or complex expressions to generate links, API paths, and identifiers cleanly.

View on GitHub
Deep Wiki
Context7

UriTemplate expander for php and a library of common uri templates.

Frequently asked questions about Uri Template
How do I install gdbots/uri-template in a Laravel application?
Install it with Composer; there is nothing to publish. The package ships no service provider, facades, config file, migrations, or assets, so a standard composer require is the whole setup. Wrap it in an application-owned service class and bind that in a service provider so your code never references the Gdbots namespace directly.
Which PHP and Laravel versions does gdbots/uri-template support?
The last release was December 2021, so the composer.json constraint is the first thing to verify. A library from that era may declare a PHP 7.x requirement that conflicts with the PHP 8.1+ floor of modern Laravel versions. Confirm it installs against your target Laravel without ignore-platform-reqs, and expect to fork the package if the constraint blocks you.
Does gdbots/uri-template support all RFC 6570 expression levels and modifiers?
RFC 6570 defines four expression levels plus prefix and explode modifiers, and reserved versus unreserved character handling is exactly where implementations quietly diverge. The overview advertises simple and reserved variables with path, query, and fragment expansion, but you should confirm which levels and modifiers are actually covered and whether the repository contains a conformance suite. Write your own tests around the specific expressions you depend on rather than assuming full spec coverage.
What is gdbots/uri-template used for in a Laravel application?
It handles standards-based URI construction anywhere your app currently glues URL strings together. Typical fits are hypermedia links such as HAL, JSON:API, and Siren, resolving link objects from OpenAPI or JSON Schema documents, generating outbound webhook and callback URLs from stored templates, and building multi-tenant or multi-region endpoint URLs. If you have no RFC 6570 requirement, the package solves a problem your product does not have.
Is gdbots/uri-template better than guzzlehttp/uri-template?
guzzlehttp/uri-template is actively maintained, widely depended upon, and often already present transitively through Guzzle in a Laravel stack. gdbots/uri-template has zero stars, zero dependents, and no release since December 2021, so there is no upstream patch path or community triage. Choose it only if it offers something concrete guzzlehttp does not, and otherwise prefer the maintained option inside the same adapter interface.
How do I wrap gdbots/uri-template behind a Laravel interface and service provider?
Define an interface such as App\Contracts\ExpandsUriTemplates with a method that accepts a template and a variable array and returns a string. Write a thin implementation that delegates to the Gdbots expander and bind it in a service provider. Because no application code imports the Gdbots namespace, you can swap or fork the implementation without touching controllers, jobs, or console commands.
Is gdbots/uri-template safe to use in production?
The dominant risk is stewardship rather than code: the package is unmaintained, has no dependents, and there is no one to escalate to when an RFC edge case bites. The mitigating factor is that the code surface is small enough to vendor, audit, and own outright, which would not be realistic for a heavier dependency. Apache-2.0 licensing is commercially clean and carries a patent grant, and the library does not touch routing, the container, or the HTTP kernel.
How should I test URI template expansion in a Laravel app?
Test through your own adapter interface rather than against the Gdbots classes directly. Cover reserved and unreserved characters, prefix and explode modifiers, empty and list values, and percent-encoding of values containing slashes, spaces, and non-ASCII text. Add explicit cases for any user-influenced variables, since unverified expansion feeding redirects or server-side requests is an injection surface.
Can gdbots/uri-template be used for routing or for expanding user-supplied variables?
The library expands and matches templates; it does not route requests or validate URLs, so do not treat it as a router or a sanitizer. Expansion of user-influenced variables is an injection surface whenever the resulting URL feeds a redirect, a callback, or a server-side HTTP request. Validate and allowlist hosts and schemes in your adapter before anything consumes the expanded string.
How do I maintain gdbots/uri-template if it is abandoned?
Fork or vendor the code, name an internal owner, and treat your fork as the supported version; the Apache-2.0 license permits this and includes a patent grant. The bundled catalog of common templates appears tuned to gdbots conventions, so treat it as reference material rather than a contract your application depends on. Keeping the fork behind your ExpandsUriTemplates interface makes a later swap to a maintained library a one-file change.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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