samedi 2 septembre 2017

Laravel Database migration procedure

I am currently using laravel 5.4. i have a seperate db per client. i would like to run database migrations in all my clientdb's. clientdb name is in the format of clientdb_{clientid}. I have tried using

Config::set("database.connections.mysql", ["database" => "clientdb_".$client['id'],"username" => "root","password" => ""]);

$this->callSilent('migrate', [ '--path' => 'database/migrations/clients','--database'=>'clientdb_'.$client['id']]);

but i am getting exception called

[InvalidArgumentException] Database [clientdb_1] not configured.

please help me out of it..



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire