-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add support for custom too many relations #30
Add support for custom too many relations #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Thanks for raising, and yes I'm open to changing this. See my comment on the PR - hopefully it makes sense as to how to modify the PR along the lines I'm suggesting? Just ask questions if it doesn't make sense.
relations as well as adding support for custom for custom too one relations
We're very grateful that we've been able to make Laravel JSONAPI meet our needs thus far and find it to be an awesome implementation! I also realize this is not the 'day' job. That said, I'll sleep better at night once this is tagged, as we are on a tight timeline. |
No worries, just looking at it now! |
@genyded quick question for you - how are you using this with the custom relation package? That package seems to be on Laravel 9, but this package is on Laravel 10? |
Tagged as I'd prefer not to have to backport this to Laravel 9, but let me know how you're currently using the custom relations package. |
No worries. We are not using that package but our own implementaion in 10.
That was just an example to help explain.
…On Sun, Oct 29, 2023, 9:00 AM Christopher Gammie ***@***.***> wrote:
Tagged as v3.1.0 which is for Laravel 10.
I'd prefer not to have to backport this to Laravel 9, but let me know how
you're currently using the custom relations package.
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQLTCDMUXQTVLMLFMJCYTYBZHO3AVCNFSM6AAAAAA6PU5A7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBUGEZDEMRZGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Any plans to release your own implementation? I actually think it'd be really useful to link to from the Laravel JSON:API docs if you were going to open source it, as it would allow people to do more complex relations on their models, which they can then use for JSON:API. |
Sorry, can't, it's for my day job. But it's pretty similar to any custom
relation library out there. Just override the abstract methods on the base
class with custom queries that return the desired results.
…On Sun, Oct 29, 2023, 10:40 AM Christopher Gammie ***@***.***> wrote:
Any plans to release your own implementation? I actually think it'd be
really useful to link to from the Laravel JSON:API docs if you were going
to open source it, as it would allow people to do more complex relations on
their models, which they can then use for JSON:API.
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQLTHUI4ORXBHXGRZFEMLYBZTHJAVCNFSM6AAAAAA6PU5A7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBUGE2DOMZYGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
We need support for custom relations like https://github.com/culturegr/custom-relation. However Laravel JSONAPI is restricted to the default types (HasMany, etc). This simple change allows our needed custom 'too many' relation to work in Laravel JSONAPI and does not seem to have any side effects. We hope it can be integrated or an alternative added so that we can continue using the library.