chrishalbert/laravel-nomadic
Laravel Nomadic provides flexible multi-database support for Laravel apps, making it easier to configure and switch database connections at runtime. It’s useful for multi-tenant applications, per-tenant databases, and isolating data while sharing one codebase.
v2.0.1 is a documentation and DX release on top of 2.0.0 — no breaking changes, no new runtime behaviour. If you are already on 2.0.0, upgrading is a safe patch bump; the value is in the docs and the newly documented extension points.
Minimal path to first value:
composer require <vendor>/<package> (^2.0).php artisan vendor:publish --provider="<Vendor>\<Package>\<PackageServiceProvider>". Check the published config/<package>.php for the migration table key and the hooks/events block.php artisan migrate before you touch the migration table name (see Gotchas).First use case to try: instead of subclassing or forking the package's default behaviour, register a listener against one of its documented events in your own EventServiceProvider and mutate/augment the payload there. That is the intended 2.x extension model and the fastest way to confirm you understand the hook contract.
Event-driven hooks as the primary extension mechanism. The documented pattern in 2.0.1 is to react to package events rather than override classes. Practical workflow:
PackageHooksServiceProvider (keeps them discoverable and easy to remove).ShouldQueue. Hooks fired inline in a request cycle are the classic source of latency regressions.Stubs for team conventions. Publishing and editing stubs is the low-effort way to make generated classes match your codebase — namespaces, base classes, declare(strict_types=1), constructor promotion, DTO style. Treat the published stub directory as a first-class artefact: commit it, and add a short note in your README on which stubs you have customised and why. When the package ships updated stubs, diff them against yours before blindly overwriting.
Customisable migration table. Useful when the default table name collides with an existing table, or when you want a naming convention shared across packages. Pattern: set the table name in config, ensure it's set consistently across every environment (config cache included), and only then run migrations. For multi-tenant setups, verify whether the table name is read at migrate time only or also at runtime — if runtime, it becomes a per-tenant concern and belongs in your tenancy bootstrap, not a static config value.
Typical integration flow: publish config + stubs → customise stubs → wire hooks in a service provider → adjust migration table if needed → migrate → add a feature test that exercises one hook end-to-end.
migrate in any environment.php artisan config:cache in deploy scripts will pin the migration table and any hook toggles. If behaviour differs between local and staging, clear and rebuild the cache before debugging anything else.vendor:publish time and never auto-update. After a package upgrade, re-publish to a temp directory and diff.php artisan event:list to confirm exactly what is registered, and Event::fake() in tests to assert dispatch counts.bootstrap/providers.php / config/app.php registration before assuming a package bug.How can I help you explore Laravel packages today?