-
-
Notifications
You must be signed in to change notification settings - Fork 785
Closed
Labels
Description
In my database.php file, my config/database.php file has the following connection specified:
'mysql' => [
'read' => [
'host' => env('DB_HOST_READ') . (('homestead' == env('DB_USERNAME') && 'homestead' != gethostname()) ? ':33060' : '')
],
'write' => [
'host' => env('DB_HOST_WRITE') . (('homestead' == env('DB_USERNAME') && 'homestead' != gethostname()) ? ':33060' : '')
],
'driver' => 'mysql',
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
and this results in the following error:
[Exception]
Whoops, Undefined index: host
When I change my config/database.php file to:
'mysql' => [
'driver' => 'mysql',
'database' => env('DB_DATABASE'),
'host' => env('DB_HOST') . (('homestead' == env('DB_USERNAME') && 'homestead' != gethostname()) ? ':33060' : ''),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
...it works like a charm. Just something to be aware of.