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

[8.x] Fixes missing lazy() and lazyById() on BelongsToMany and HasManyThrough relation query builder #36758

Merged
merged 1 commit into from
Mar 26, 2021

Conversation

crynobone
Copy link
Member

@crynobone crynobone commented Mar 26, 2021

Current Behaviour

$user = User::find(1);

foreach ($user->roles()->lazy() as $role) {
     // $role->pivot === null because additional select to retrieve pivot wasn't available
}

Signed-off-by: Mior Muhammad Zaki [email protected]

…hrough relation query builder.

Signed-off-by: Mior Muhammad Zaki <[email protected]>
@crynobone crynobone changed the title Add lazy() and lazyById() to BelongsToMany and HasManyThrough relation query builder. [8.x] Fixes missing lazy() and lazyById() on BelongsToMany and HasManyThrough relation query builder. Mar 26, 2021
@GrahamCampbell GrahamCampbell changed the title [8.x] Fixes missing lazy() and lazyById() on BelongsToMany and HasManyThrough relation query builder. [8.x] Fixes missing lazy() and lazyById() on BelongsToMany and HasManyThrough relation query builder Mar 26, 2021
@taylorotwell taylorotwell merged commit 31c5e1f into laravel:8.x Mar 26, 2021
@crynobone crynobone deleted the relation-lazy branch April 5, 2021 09:23
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.

2 participants