- What is Laravel Nomadic and what does it do?
- Laravel Nomadic is a Composer package that extends Laravel's built-in migration system with flexible multi-database support. It lets you configure and switch database connections at runtime, which is useful for multi-tenant applications, per-tenant databases, and shared-codebase data isolation. It also adds a customizable migration table and event-driven hooks, plus publishable config and stubs.
- Which Laravel and PHP versions does chrishalbert/laravel-nomadic support?
- The package follows standard Laravel extension points such as service providers, publishable config, and Artisan stubs, so it likely targets Laravel 10 and 11 on PHP 8.1 or newer. The exact constraints are defined in the package's composer.json, so always confirm them before installing. Check the repository README and the 2.0.0 upgrade guide for the authoritative version support matrix.
- How do I install Laravel Nomadic with Composer?
- Install it with composer require chrishalbert/laravel-nomadic, then publish the configuration, migrations, and stubs using the package's vendor:publish tags. Run php artisan config:clear after publishing so the new settings take effect. Review any published migration files before running them in a shared or production database.
- How do I set up per-tenant database connections with Laravel Nomadic?
- Configure your tenant connection definitions in the published config file, then switch the active connection at runtime based on the current tenant. Set the custom migration table name before running your first migration, because that decision affects schema ownership. Test the switching logic in staging against a real second database to confirm migrations and rollbacks behave as expected.
- What changed between Laravel Nomadic 1.x and 2.0.0?
- Version 2.0.0 is a major release and may include breaking changes from 1.x, while 2.0.1 is primarily documentation and developer-experience improvements. Treat 2.0.0 as the real migration target and read its upgrade guide carefully. Branch before upgrading, run your full test suite, and rehearse any data migration if a table rename is involved.
- Can I customize the migration table name in Laravel Nomadic?
- Yes, the package supports a customizable migration table name, which helps with multi-tenant setups and naming-convention constraints. This shifts schema ownership decisions to your team, so document the chosen name in your runbooks before the first migration. Confirm whether the customization supports renaming an existing table or only greenfield installs, and verify it works with config caching.
- Are Laravel Nomadic's event hooks synchronous or queued, and what payloads do they receive?
- The event-driven hooks integrate with Laravel's event dispatcher, but the package documentation should be checked for whether listeners run synchronously or can be queued. Payload shape and firing order are important contracts, so pin a version and test listener behavior after upgrades. For high-volume applications, prefer queued listeners to avoid adding request latency.
- Is Laravel Nomadic safe to use in production for multi-tenant applications?
- It can be a good fit for multi-tenant and per-tenant database architectures, but the 2.0.0 major-version boundary deserves caution. Install v2.0.1 in a non-production branch, review published config and stubs, and run migrations plus event-hook integration tests in staging first. Canary deploy with a rollback plan and assign an internal owner for upgrades and incident triage.
- Does Laravel Nomadic work with MySQL, PostgreSQL, and SQLite?
- The package builds on Laravel's database layer, so it should work with the drivers Laravel supports, including MySQL, PostgreSQL, and SQLite. However, you should validate driver-specific behavior for migrations and table renaming in your own environment. Check the repository's test matrix for the officially verified database drivers.
- Is Laravel Nomadic actively maintained, and what are the alternatives?
- Maintenance activity should be verified directly on the GitHub repository by checking recent commits, releases, and issue responsiveness. Because 2.x is a major version, track patches and event-contract changes closely. Alternatives include Laravel's native multi-connection configuration plus packages like stancl/tenancy, depending on whether you need per-tenant databases or simpler runtime connection switching.