I am using laravel5.1 with mongoDb. In my application i have separate database for each user.
When user login i set database as per user DB using Config::set('Key' : 'Value').
when i try to get current database connection using Config::get('database) everything worked fine but when i am trying to get data from database then it return default database data.
DB::purge('mongodb-name');i used this afterConfig::set("Key","value"). And its work for me.