-
Notifications
You must be signed in to change notification settings - Fork 96
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
WithPivot removed during transformation #71
Comments
Hey @DrRamazzotti could you please provide some code examples of your models and the route you are calling? |
Hi Max,
In the meantime I got a glue.
vendor/specialtactics/l5-api/src/Transformers/RestfulTransformer.php
There is the issue
Lines 232 to 234
// We don't really care about pivot information at this stage
if (isset($transformedRelatedModel['pivot'])) {
unset($transformedRelatedModel['pivot']);
}
Its just coded that while transformation it's removed
Bernhard
…________________________________
Von: Max ***@***.***>
Gesendet: Sonntag, 11. Februar 2024 10:40
An: specialtactics/laravel-api-boilerplate ***@***.***>
Cc: DrRamazzotti ***@***.***>; Mention ***@***.***>
Betreff: Re: [specialtactics/laravel-api-boilerplate] WithPivot removed during transformation (Issue #71)
Hey @DrRamazzotti<https://github.com/DrRamazzotti> could you please provide some code examples of your models and the route you are calling?
—
Reply to this email directly, view it on GitHub<#71 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AELGECWHFUIJD5DERTYPLW3YTCGZTAVCNFSM6AAAAABB2D37CSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXGQ4TIMJYGY>.
You are receiving this because you were mentioned.
|
Hey @DrRamazzotti - happy to work on this, but can you give me some examples of how you are using pivots? Can you post some example models and a controller code and what you expect? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a many to many relation with additional fields.
It works fine until I try to query a item or collection with additional fields.
Return the "pure" raw item the additional pivot fields are there.
Using return $this->response->item($company, $this->getTransformer()); the additional fields wont appear.
The text was updated successfully, but these errors were encountered: