I'm using DB::disconnect
and DB::reconnection
for connect database for multi tenant system in Laravel 5.2.
The code is as:
DB::disconnect();
Config::set('database.connections.mysql', $config);
DB::reconnect();
Where $config is array of configurations to be set, this is working fine when i have to change only database name, but when i want to change the prefix for database it is not working, every time it takes old database.
I have tried to config:cache
from the Middleware where i change the connection but it removes all input variables.
So, What Can I do for change prefix of DB connection? Any help?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire