2016年8月31日 星期三

laravel Change Database connection run time

You can change the connection details during run time using 
Config::set('database.connections.mysql.database', 'other_database');
but don't forget to purge before to delete the cache
DB::purge('mysql');

reference : http://stackoverflow.com/questions/31041893/laravel-change-database-connection-run-time

沒有留言:

wibiya widget