vendredi 28 avril 2017

Laravel 5.4 How to update database connection for migration

I have post request where I update database config. I save data for one connection in my storage. In database config I call function to get it.

When data are updated I also update local config by config('database.connections.myconnection',$newConf)

The problem is in artisan:migrate action. In the same request I need to call to artisan:migrate but with new datbaase configuration.

Unfortunately I can set only database string to Artisan::call('migrate',['database'=>'myconnection'])

Migrate try to use old db data and I get error about db connection.

Someone have any idea how I can provide new config for migrate "in fly"?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire