Monorepo Support
Laravel Cloud doesn’t officially support monorepos yet, but it is possible to work around this limitation wtih a custom build script.
Monorepo support is not officially available yet, but we’re actively working on support for this feature. In the meantime, some users have had success using the workaround below. Use at your own risk — Laravel Cloud Support may be unable to assist with debugging custom monorepo configurations.
How It Works
You’ll need a fakecomposer.lock
in your repository root. You can simply copy the composer.lock
file from your Laravel application subdirectory and place it in the root of your monorepo, committing it to source control. This indicates to Laravel Cloud that your monorepo contains a Laravel application. This composer.lock
file does not need to be kept up to date.
Next, customize your environment’s build script in Laravel Cloud to move your Laravel application subdirectory (e.g., laravel_app
) into the root directory before running composer install
and the rest of your build commands:
Notes:
- Replace
laravel_app
with the name of your Laravel app directory that you want to deploy. - If your app has dependencies on sibling directories (like shared packages or configuration), you will need to adjust paths manually or restructure accordingly.
Was this page helpful?