Skip to content

Commit

Permalink
Passing the correct argument to addConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafasoufi committed Oct 4, 2021
1 parent db18dcf commit addcd5f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/Database/DatabaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ public function boot() {
$container = $this->getContainer();

$container
->share('database' , Capsule::class )
->addMethodCall('addConnection' , [
['driver' => 'mysql',
'host' => DB_HOST,
'database' => DB_NAME,
'username' => DB_USER,
'password' => DB_PASSWORD,
'charset' => DB_CHARSET]
])
->addMethodCall('setAsGlobal');
->share('database', Capsule::class)
->addMethodCall('addConnection', [
'config' => [
'driver' => 'mysql',
'host' => DB_HOST,
'database' => DB_NAME,
'username' => DB_USER,
'password' => DB_PASSWORD,
'charset' => DB_CHARSET
]
])
->addMethodCall('setAsGlobal');

// Boot eloquent should be when capsule is initialized.
$container->get('database')->bootEloquent();
Expand Down

0 comments on commit addcd5f

Please sign in to comment.