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

[6.x] Implement withoutRelations method #30802

Merged
merged 2 commits into from Dec 10, 2019
Merged

Conversation

@driesvints
Copy link
Member

driesvints commented Dec 10, 2019

This will allow to unload all of the model's relations so it can be used, for example, to not overload queued jobs. This allows for example to do this in a queued job:

protected $podcast;

public function __construct(Podcast $podcast)
{
    $this->podcast = $podcast->withoutRelations();
}

This way those queued jobs won't be overloaded. I'll document this once it's merged.

Fixes #27148

This will allow to unload all of the model's relations so it can be used, for example, to not overload queued jobs.
@driesvints driesvints changed the title Implement withoutRelations method [6.x] Implement withoutRelations method Dec 10, 2019
@taylorotwell taylorotwell merged commit e32442b into 6.x Dec 10, 2019
2 of 4 checks passed
2 of 4 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/styleci/push The analysis has passed
Details
@driesvints driesvints deleted the model-without-relationships branch Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.