Specify to the table, not the DB implementation.
I'm not a big fan of the 'feature' that allows cross DB querying on MySQL between DB's on the same server. This is what would allow the thing you mention.
- If you change the name of your db you'll need to refactor your table names in your code.
- If you create a test db like
table_name_test
to test your code or a db modification, you'll have to modify all your tables tames in your code each time you jump between db's vs. just editing the config file. - What if you move to a differnt DB technology without DB names (one Db per server/fuile, you'll need to refactor your table name properties in each class)
- It leads down the dark, tempting yet vile path of cross db queries like
select * from db1.foo f Join db2.bar b on b.id = f.id;
. Congratulations you just turned your 2 dbs into actually one big db that might not run outside MySQL
Also, even though you're specifying three connections, you're probably not making a connection and using all three at once... I hope. If you do use all 3 connection per request to you laravel app/site saving 2 connections is probably, micro optimization.