zenstruck/dsn
A small PHP library for parsing and composing DSN (data source name) strings into structured objects, with support for custom schemes, validation, and clean access to connection credentials and options. Useful for configuring database and service connections from environment variables.
scheme://user:pass@host:port/path?opt=val. That is a product-visible decision — one pasteable string versus five form fields — and a parser like this is the plumbing that makes it cheap.^1.0 and stop tracking it for breaking changes; the Symfony 8 constraint and deprecation cleanup signal the maintainer is keeping pace with the ecosystem rather than abandoning it. That is a "keep, don't churn" signal for a dependency review.Consider it when:
Look elsewhere when:
parse_url() is in the standard library and costs nothing.league/uri (or similar) instead; a DSN parser is deliberately narrower.On this specific release: the changelog is stabilization, not new capability — Symfony 8 compatibility, deprecation fixes, and a documentation path correction. No breaking API changes are itemized; the 0.2 → 1.0 jump should be read as a stability commitment rather than a rewrite. Verify against your own smoke tests before pinning, as with any major bump.
For executives: This is a small, low-risk utility dependency, and the 1.0 release is the story — it means we can pin a stable version and stop spending review cycles on it. Its practical value is enabling a "paste your connection string" setup experience across our integrations, which reduces support tickets and shortens time-to-first-success for new customers. Cost is negligible; strategic weight is low. Approve it as infrastructure, not as a bet.
For engineering: Single-purpose DSN parser with a small surface area and no I/O. Framework-agnostic — usable in Laravel service providers and Symfony bundles alike — now with a Symfony 8 constraint and cleaned-up deprecations, so it will not block an upgrade path. Pin ^1.0. Adopt it where we have two or more DSN-shaped configuration inputs to normalize; for a one-off parse, use parse_url() and skip the dependency. If requirements grow toward full URI handling, plan a migration to league/uri rather than stretching this package past its scope.
How can I help you explore Laravel packages today?