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');
2.1m questions
2.1m answers
60 comments
57.0k users