I have a laravel app deployed in DO App platform but when I add my laravel app to trusted sources it could not connect to managed mongodb database anymore. However, when I open the DB for all connections, it connects and work successfully.
I am using laravel mongodb extension v5.1 to connect with mongodb. Anyone faced this problem and resolved it?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
Are you truing to connect to the MongoDB cluster during the build stage?
If this is the case, keep in mind that during the build process your app would not have access to the Managed Database clusters in case that you have the trusted sources enabled.
What I would suggest is that if you have any steps that are connecting to your managed databases, you could move thise steps from the build process to the deploy process.
In general, the benefit of doing this is that, if your build is successful and the changes to the database are executed, but the deployment fails, then you might end up with the new database schema but with your old codebase which might not be backwards compatible.
Let me know how it goes!
- Bobby