Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SiNi_Si's avatar

Multiple database Setup

Hi, I have to connect to Multiple databases from my laravel framework.

We are setup with three servers. First is the web server, and there are two licence servers. The licence servers basically have one table each that contains there login info and available licenses. This is a basic c++ to php http call with an RSA encryption. Not really important info for this question.

The main web server would need to update both licence server tables whenever a user adds a licence or changes their password, or even when the first signup need to make a new entry in both licence server tables. So the long and short is I will need to interact with 3 server database in many different parts of our web server.

Where do I start with laravel? Add all three dB info to the globe files? How mysql1 mysql2, and mysql3?

And how do I define this in a model? In my user model I would need to tell each call what dB to get or put to.

Thanks for any advice on getting started.

Si

0 likes
6 replies
D9705996's avatar

@SiNi_Si - if me response answers your question can please mark as solved so others can find the solution

SiNi_Si's avatar

sorry for the dumb question, but how do you make it solved?

D9705996's avatar

@SiNi_Si - I take it you found it but for anyone else - click the tick icon next to the correct response

1 like

Please or to participate in this conversation.