Answer the question
In order to leave comments, you need to log in
How to correctly use the prepend method on the Config facade?
Good afternoon!
There is a config/database.php file (standard in the framework). Here is a piece of code:
return [
'connections' => [
'builder.ru' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'test'),
'username' => env('DB_USERNAME', 'test'),
'password' => env('DB_PASSWORD', 'test'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
]
],
];
Config::prepend('database.connections', [
'test.ru' => [
'driver' => 'mysql'
]
]);
Answer the question
In order to leave comments, you need to log in
Судя по коду, этот класс вообще ничего на диск не пишет, поэтому вам и кажется, что ничего не работает. Поищите в исходниках как записать значения на диск (ну или просто пишите через file_put_contents(var_dump($cfg)));
;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question