queue - Change Database in Laravel Job File -


i have laravel job file trying change database in handle function.

so in controller passing database name dynamically this.

$job = (new mjob($id,$list,$mdb))->delay(120); 

$mdb dynamic value database.

now in handle function using code change database dynamically.

config::set(['database.connections.mysql.database' => $this->mdb]); db::reconnect(); 

but db not changing dynamically.

can 1 tell me doing wrong?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -