- How do I install nscreed/laravel-migration-paths?
- Install it with Composer using composer require nscreed/laravel-migration-paths. Laravel package discovery should register the service provider automatically. After installation, publish any package configuration if the package provides it and register your additional migration directories before running migrations.
- How do I register an additional migration path in Laravel?
- Use the package configuration or service provider registration to point Laravel at your extra migration directories. The package is designed to let you keep package, module, or domain migrations outside the default database/migrations folder. Once registered, run php artisan migrate as usual and the package resolves the added paths.
- Can I run migrations from package or module directories?
- Yes. The package is intended for exactly that use case: keeping package, module, or domain migrations organized in their own directories. Register those directories with the package and Laravel's migrate command can discover and run them without custom scripts.
- Which Laravel and PHP versions does laravel-migration-paths support?
- The provided context does not list exact supported Laravel and PHP versions, so check the package's composer.json and README before adopting it. Release 1.2.0 is described as a minor release and should be backward-compatible for existing in-app path usage. Verify compatibility with your Laravel version in a non-production branch first.
- Does laravel-migration-paths change the default database/migrations path?
- The package is described as adding custom migration paths rather than replacing the default one. Release 1.2.0 concerns resolving paths outside the Laravel application root, but existing in-root path resolution should be regression-tested after upgrading. Confirm in staging that migrations in database/migrations still run unchanged.
- How do I configure multiple custom migration paths?
- Register each additional directory through the package's configuration mechanism, then run artisan migrate normally. Because the context does not document exact config keys, follow the README for the release you install. Keep a clear list of approved paths, especially if some point outside the Laravel base path.
- Can I use migration paths outside the Laravel application root?
- Release 1.2.0 expands the package to support paths and directories outside the Laravel application root. That helps with monorepos, shared storage, symlinked deployments, and package development. Test path canonicalization, permissions, symlinks, and Windows hosts before relying on it in production.
- How do I test custom migration paths before deploying?
- Add targeted tests that assert migrations from each registered directory are discovered and run. Validate outside-root paths in containerized, CI, and symlinked release environments, not just your local machine. Also test missing directories and permission failures so failures are clear.
- What production risks come with external migration paths?
- The main risks are permission denied errors, missing directories, symlink resolution differences, path canonicalization mismatches, and paths that exist locally but not in CI or production. Constrain allowed external paths explicitly if the package exposes configuration for them. Treat release 1.2.0 as behavior-affecting and validate it in staging.
- What alternatives exist to custom migration paths in Laravel?
- You can manually load migrations in a service provider, use package-specific migration publishing, or keep all migrations in database/migrations. This package is useful when you want package, module, or domain migrations discoverable while still running artisan migrate normally. Choose it when built-in publishing and default path assumptions are too limited.