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

[9.x] Adds withoutEagerLoad function #42641

Merged
merged 2 commits into from
Jun 3, 2022
Merged

[9.x] Adds withoutEagerLoad function #42641

merged 2 commits into from
Jun 3, 2022

Conversation

mahmoudmohamedramadan
Copy link
Contributor

According to this PR I have added a withoutEagerLoad to prevent the given relationships from being eagerly loaded.

$user = \App\Models\User::with(['post', 'attachment'])->first();

// This line will return the first user with the post relationship
return $user->withoutEagerLoad(['attachment'])->first();

@taylorotwell taylorotwell merged commit c24bf57 into laravel:9.x Jun 3, 2022
@GrahamCampbell GrahamCampbell changed the title Adds withoutEagerLoad function [9.x] Adds withoutEagerLoad function Jun 3, 2022
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.

3 participants