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

micro-module/dsn

micro-module/dsn is a small PHP package for parsing, building, and handling DSN (Data Source Name) connection strings, making database or service connection details easier to manage in Laravel and PHP applications.

View on GitHub
Deep Wiki
Context7

A lightweight DSN parser for PHP and Laravel that turns connection strings such as mysql://user:pass@host:3306/db into clean, structured configuration arrays. Part of the micro-module family, it keeps parsing logic isolated and reusable across services.

  • Parses scheme, credentials, host, port, path, and query options
  • Supports multiple protocols via a pluggable scheme handler
  • Ships with a Laravel service provider and config binding
  • Validates malformed DSNs with clear exceptions
  • Zero dependencies beyond PHP itself
Frequently asked questions about Dsn
What is micro-module/dsn used for in Laravel?
It parses DSN connection strings such as mysql://user:pass@host:3306/db?charset=utf8 into structured components for configuration. In Laravel it is most relevant when consuming PaaS-injected values like DATABASE_URL, REDIS_URL, AMQP_URL, or SENTRY_DSN. Laravel already accepts url keys in config/database.php and config/queue.php, so the package is additive rather than enabling. Treat it as a leaf utility, not a framework integration.
How do I install micro-module/dsn with Composer?
The expected command is composer require micro-module/dsn, but first verify it resolves from Packagist with the micro-module bootstrap available. Check the dependency graph, because a zero-star package can have an unresolvable or yanked chain. Confirm the PHP constraint before installing on PHP 8.1 or newer, since 2020-era code may require PHP 7.2 or 7.4. Avoid --ignore-platform-reqs in production; it hides compatibility problems instead of solving them.
Does micro-module/dsn support Laravel 10 and Laravel 11?
There is no evidence of validated Laravel 10 or 11 support. The package is a single-purpose parser with no expected service provider, and its last release was 2020-12-18 with zero dependents. That means no downstream integration has tested it against a modern Laravel version. You would be the first to verify installation, runtime behavior, and PHP compatibility on your stack.
How does micro-module/dsn compare to Laravel's built-in url config keys?
Laravel already resolves DB_URL and REDIS_URL through url keys in config/database.php and config/queue.php, using parse_url internally. Adopting a package for the same job is additive and may not be worth the review, pinning, and future migration burden. The alternative is a small custom parser or a few lines of code around parse_url. Evaluate whether the package saves enough effort to justify another dependency in the config path.
Does micro-module/dsn handle URL-encoded passwords and IPv6 hosts?
That is unclear from the package context, and these are exactly the edge cases that break naive DSN parsing. Examples include URL-encoded credentials such as p@ssw0rd%21, IPv6 literals such as [::1]:3306, multi-host DSNs, empty userinfo, scheme-less strings, and query-string coercion. With no visible test suite and no dependents, assume these cases are untested until you verify them yourself. Test the DSN shapes your production environment actually emits.
What happens when micro-module/dsn receives a malformed DSN?
The failure semantics are not documented in the provided context, which is a significant operational risk. A thrown exception during config loading can take down the whole application at bootstrap, while a silent partial parse can produce a confusing runtime failure later. Check whether it throws, returns null, or returns partial results before using it in a boot path. This is the most important behavior to test before adoption.
Is micro-module/dsn safe to use in production?
The maintenance risk is high: single author, no release since 2020-12-18, no issue triage, and no security process. Installing a zero-audience package from a personal GitHub account into a Laravel boot path is also a supply-chain exposure. The value delivered is small, string to array, so weigh that against pinning and future migration burden. Prefer native Laravel URL handling or a small reviewed parser unless the package proves clearly necessary.
Can I use micro-module/dsn without the micro-module framework bootstrap?
It is not clear from the context whether the package can be consumed standalone. The micro-module namespace suggests it may follow its own manifest, autoload shim, or runtime conventions rather than vanilla PSR-4 and service provider patterns. If it pulls in a micro-module core runtime just to parse a string, that is a disproportionate architectural commitment. Verify standalone usage before adding it to a Laravel application.
Does micro-module/dsn parse Redis, AMQP, Sentry, or S3 DSNs?
The package is described as a general DSN parser, but it is unknown whether it is MySQL-shaped or covers other schemes. Test the non-database DSNs you care about, including Redis, AMQP, Sentry, and S3-style connection strings. Check scheme handling, path parsing, and typed query parameters such as booleans and integers. Do not assume broad protocol support from a single-purpose library with no dependents.
What are alternatives to micro-module/dsn for parsing DSNs in PHP?
The main alternatives are Laravel's native url keys, parse_url plus your own edge-case handling, or roughly 30 lines of custom code for the specific DSN formats you use. A maintained third-party DSN parser is another option if it has tests and recent releases. For a one-class problem, compare the dependency cost against writing and testing a small resolver yourself. In many Laravel apps the native URL configuration is already sufficient.
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
cgv/localized-resource