Closed ItsClassified closed 1 month ago
Just to add a bit more, the issue is when it tries to merge database.connections
, as PHPs array_merge()
is doing some annoying type juggling and assuming keys that are numeric strings, are, in fact, just numeric, and it's resetting those keys.
Laravel Version
11.23.5
PHP Version
8.3.11
Database Driver & Version
MySQL
Description
When using numeric values in the database.php config file Laravel will disregard the names and load them starting from 0, and increasing for each connection after that with a numeric value as name.
@ollieread found that commenting out row 127 in the following file makes it load in again: https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php#L103
The issue appears to be on L103 using
array_merge
Steps To Reproduce
Change a connection name to a numeric string, for example: '12345' and try to access it using DB::connection.