Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Make DB::usingConnection() respect read/write type #50806

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

SajtiDH
Copy link
Contributor

@SajtiDH SajtiDH commented Mar 28, 2024

fixes #50804

Currently when DatabaseManager::connection() is used with default connection it doesn't get a $name param and it is resolved within a subsequent call to DatabaseManager::parseConnectionName() and then use only the first $database segment without the type to look for already created connection instance so the ::write part won't take effect.

This PR solves the issue by resolving the default connection's name before parsing it.

@driesvints driesvints changed the title Make DB::usingConnection() respect read/write type [11.x] Make DB::usingConnection() respect read/write type Mar 28, 2024
@taylorotwell taylorotwell merged commit f25fcd2 into laravel:11.x Mar 28, 2024
28 checks passed
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.

DB::usingConnection() doesn't respect read/write type
2 participants