Skip to content

Conversation

jnoordsij
Copy link
Contributor

Within the scope of #56878 some ternaries were replaced with null-coalescing operators in the logic of DatabaseManager. This is a behavioral change w.r.t. explicitly empty string being used for connection names. These would previously fall back to being treated as the default connection (due to being falsey), but no longer are. An example of such usage can be found at https://github.com/Flynsarmy/laravel-csv-seeder/blob/master/src/CsvSeeder.php#L37.

Whether or not such cases should be considered valid or not, especially in the long run, is up for debate (given they should probably use an explicit null instead of empty string). However, to prevent further disruption for now, this PR reverts back to using ternaries. If wanted, this may be reverted in a future (major) version.

Should close #56888 and fix #56892.

@taylorotwell taylorotwell merged commit 136f4eb into laravel:12.x Sep 3, 2025
65 checks passed
@jnoordsij jnoordsij deleted the databasemanager-allow-empty-name branch September 3, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Database connection [] not configured. InvalidArgumentException in database seeders only in ^12.27

2 participants