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

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
@driesvints driesvints deleted the model-without-relationships branch December 10, 2019 15:54
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.

Queue performance question/documentation update?
2 participants