I want to change the default database in laravel on change of a session key lets say, by default the session key is 'ff' => '20' and the default db is 'default' => env('DB_CONNECTION', 'mysql') and now when I change the value of session key from 'ff' => '20' to 'ff' => '21' I want to change the default db to 'default' => env('DB_CONNECTION', 'mysql2') for all the subsequent request till I don't change the session key again.
I am using laravel 5.5