I need to change laravel 5 database connection in run time.
Do you have any idea about it?
Please share with me.
Thanks.
You can change the connection details during run time using
Config::set('database.connections.mysql.database', 'other_database');
but don't forget to run purge before in order to delete the cache
purge
DB::purge('mysql');
1.4m articles
1.4m replys
5 comments
57.0k users