Z
Z
zxcursed2022-02-25 15:57:24
Laravel
zxcursed, 2022-02-25 15:57:24

How to select base in laravel?

I have a server with 6 databases: db1, db2, db3, db4, db5, db6
How do I specify which database I want to connect to when querying without creating 6 copies in config/database.php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JhaoDa, 2022-02-25
@JhaoDa

The only option, as I see it, is to change the key on the fly databasein the connection config. Smells like crutches.

P
pLavrenov, 2022-02-25
@pLavrenov

Laravel:Database - Documentation
Search for DB::connection
I'll probably be Vanga and show the author the package he's most likely looking for.
there he is

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question