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

[5.2] Add without() method to remove specified eager loads #14031

Merged
merged 1 commit into from
Jun 17, 2016
Merged

[5.2] Add without() method to remove specified eager loads #14031

merged 1 commit into from
Jun 17, 2016

Conversation

JayBizzle
Copy link
Contributor

We have an application with some Models that nearly always needs to eager load a relationship. We use the $with parameter on the Model to achieve this.

However, in a very small number of instances, we need to load the Model without the specified eager loads (for performance reasons).

We have added the without() method to facilitate this.

@taylorotwell taylorotwell merged commit 1d52300 into laravel:5.2 Jun 17, 2016
@GrahamCampbell
Copy link
Member

Thank you @JayBizzle. 🚀

@gocanto
Copy link
Contributor

gocanto commented Jun 27, 2016

Quick question.

Is the relation loaded even though with is not present?

@GrahamCampbell
Copy link
Member

This is meant to override the property on a model which says what relations are loaded by default.

@gocanto
Copy link
Contributor

gocanto commented Jun 27, 2016

thanks though

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.

4 participants