How do the two laravel projects read the shared third database?

there are two laravel projects, laravel_a,laravel_b,
, which have their own database database_a,database_b, and now have some public data to read, and I want to set up a separate database database_common.

question:
how should I set up so that they can read this public database?

Mar.07,2021

create a new connection, for database_common in config/database and override the property of $connection in the model, or specify connection in the query constructor

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45b29-43631.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45b29-43631.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?