boson-php/uri-contracts
Framework-agnostic URI contracts for the Boson PHP ecosystem. Provides interface definitions for working with URIs in Boson and related packages, enabling consistent implementations and integrations across applications, windows, and webviews.
UriInterface, UriBuilderInterface) act as a shared contract, reducing coupling between services.Url Facade: Critical for teams migrating to modular architectures or adopting hexagonal design. By injecting UriInterface instead of Url::to(), services become framework-agnostic, easing future migrations (e.g., to Symfony or Lumen).file://, javascript:).?page=1) before processing.Uri class with 10+ years of usage). Evaluate if the package’s interfaces add meaningful value beyond existing solutions.WebhookUriInterface before processing.str_replace in controllers) with type-safe builders.boson-php/boson for HTTP clients or routing).Url facade and don’t need cross-service URI contracts (the abstraction overhead may not justify benefits)./api/v1/users with no dynamic segments).parse_url() with custom rules). Consider:
symfony/psr-http-message for PSR-17 compliance.spatie/url for Laravel-specific URI utilities.For Executives:
"This package lets us standardize URL handling across all PHP services, which is critical for scaling our API ecosystem and reducing bugs from inconsistent URI logic. For example, if we’re expanding into multi-region deployments, we can enforce region-specific URI formats (e.g., https://{region}.api.example.com) via shared interfaces—without custom code per service. It’s a lightweight ‘buy’ vs. a ‘build’, saving dev time while improving security by validating URIs early (e.g., blocking non-HTTPS links in production). The MIT license and PHP 8.4+ support align with our modern stack, and the Boson ecosystem could offer future synergies as we adopt microservices."
For Engineering:
*"This provides URI interfaces (UriInterface, UriBuilderInterface) to replace ad-hoc string manipulation or Laravel’s Url facade in non-core paths. Key benefits:
UriBuilder into services instead of hardcoding Url::to(), making components framework-agnostic.boson-php/boson for HTTP clients or routing.Tradeoffs:
Url::to()) before adoption.Url and Symfony’s Uri to ensure compatibility.symfony/psr-http-message or spatie/url might be more mature choices."*For Architects: *"This package addresses three critical pain points:
Url facade is tightly coupled to the framework. Interfaces let us swap implementations (e.g., for testing or non-Laravel services).file:// URIs) reduces production incidents.Recommendation: Pilot this in non-critical paths (e.g., a new API client or CLI tool) before considering broader adoption. If successful, we can gradually replace string-based URIs in middleware and services with the UriInterface contract."*
How can I help you explore Laravel packages today?