Skip to content

[5.8] Set connection name on cursor() results#28804

Merged
taylorotwell merged 1 commit intolaravel:5.8from
staudenmeir:cursor
Jun 11, 2019
Merged

[5.8] Set connection name on cursor() results#28804
taylorotwell merged 1 commit intolaravel:5.8from
staudenmeir:cursor

Conversation

@staudenmeir
Copy link
Contributor

When a model uses the default connection, cursor() doesn't set the connection name.

User::first()->getConnectionName(); // 'mysql'
User::cursor()->current()->getConnectionName(); // null

Fixes #28794.

@taylorotwell taylorotwell merged commit 1ca32c0 into laravel:5.8 Jun 11, 2019
@staudenmeir staudenmeir deleted the cursor branch June 11, 2019 20:59
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.

lluminate\Database\Eloquent\Builder::cursor() create models with wrong (null) connection

2 participants