flugg / laravel-responder

A Laravel Fractal package for building API responses, giving you the power of Fractal with Laravel's elegancy.
MIT License
861 stars 86 forks source link

Load already loaded relations #165

Open fedaa-mahmoud opened 4 years ago

fedaa-mahmoud commented 4 years ago

Hello,

I face a problem while using eager loading using transformers,

the problem that the package load the relation ship if it is already loaded, so I suggest that

$data->loadMissing($relations); instead of load method,

In eagerLoadRelations method from TransformBuilder class,

hope this change applied ASAP.

fedaa-mahmoud commented 4 years ago

@flugger Check this out pls