mardi 8 octobre 2019

How to connection multiple databases in laravel 5.5?

I have a qusetion... By the way I use Laravel 5.5 and MySQL.

I want to connection multiple databases, so I read many article. It's says to set config/database.php fisrt, and in the controller use $result = DB::connection('mysql2')->select($); to connection database. It's work for me! But I have many databases, and saved the host & port in the main database.

Then, can my connection information be queried from the database and then put into the config/database.php?

Or I should make mysql connection by myself?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire