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
Post a Comment