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

Dsn Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Configuration UX / feature shape. If you are designing how customers or internal teams point your product at an external service (mailer, queue, cache, search, storage, database), this package supports the "one connection string" pattern: 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.
  • Build vs. buy. DSN parsing looks trivial until you hit percent-encoded credentials, IPv6 hosts, empty passwords, repeated query params, and scheme-specific defaults. Buying a small, focused library is almost always cheaper than owning that edge-case surface in-house.
  • Plugin / connector roadmap. If the roadmap includes "add a new backend every quarter," a normalized DSN object means each new connector is a new scheme, not a new config schema. This directly lowers the marginal cost of each integration on the roadmap.
  • Risk register / dependency policy. The v1.0.0 tag is the headline here, not the features. Semver stability means you can pin ^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.
  • Use cases where it earns its place: multi-transport messaging layers, package/bundle authors who must accept heterogeneous connection strings, migration from bespoke per-service config arrays to a unified connection-string interface, and any product where ops teams expect to paste a URL from a provider's dashboard.

When to Consider This Package

Consider it when:

  • You are building a library, bundle, or internal shared package that must accept several kinds of connection strings and present them uniformly.
  • You want a typed value object passed around your code instead of raw strings, so validation happens once at the boundary.
  • You want DSN semantics that match the wider Symfony/PHP ecosystem, so users' existing strings behave as expected. The added Symfony 8 support matters if you ship a bundle or target current Symfony apps; for Laravel-only codebases it is a maintenance-health signal rather than a functional requirement.
  • Your dependency budget allows a small, single-purpose library — this is a parser, with no I/O, no service container magic, and a correspondingly small review and audit burden.

Look elsewhere when:

  • You need to parse exactly one URL, once. parse_url() is in the standard library and costs nothing.
  • You need real URI/IRI work — RFC 3986/3987 normalization, relative resolution, templating, IDN handling. Reach for league/uri (or similar) instead; a DSN parser is deliberately narrower.
  • You expect the library to connect as well as parse. It does not. The factory/client layer remains yours to build and own.
  • You are on a hard zero-third-party-dependency policy, or your PHP/Symfony version range falls outside what v1.0.0 declares.
  • You want Laravel-native config semantics out of the box. This is framework-agnostic, so config publishing, validation rules, and service-provider wiring are your work.

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.

How to Pitch It (Stakeholders)

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.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager