Skip to content

Why is BaseResourceService::addRelationsToExistingModel defined if it is not used? #5

Discussion options

You must be logged in to vote

Hi and welcome.
If you look at the get function

return $this->model::query()->with($withRelations)->where(

you will see we are using with.

The eager loading in laravel and lumen had and still has some bugs as you saw in the issues from laravel github laravel/framework#51825.
The get can be easily overwritten to not use with but use this unused by default function, that will avoid the eager loading.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@macropay-solutions
Comment options

Answer selected by marius-mcp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants