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

Handle related resource URLs #3

Open
tobyzerner opened this issue Dec 14, 2018 · 2 comments
Open

Handle related resource URLs #3

tobyzerner opened this issue Dec 14, 2018 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@tobyzerner
Copy link
Owner

tobyzerner commented Dec 14, 2018

As per https://jsonapi.org/format/#fetching-resources:

The following request fetches an article’s author:

GET /articles/1/author HTTP/1.1
Accept: application/vnd.api+json

These URLs can be implemented automatically as part of the Show endpoint.

For ToOne relationships, we simply get the value of the relationship and show it.

For ToMany relationships, will need to add a queryRelated($model, $field) method to the resource. We then pass this query into the relationship's collection and make filters, pagination etc available.

@tobyzerner tobyzerner added the enhancement New feature or request label Dec 14, 2018
@tobyzerner tobyzerner added this to the v1.1 milestone Jun 21, 2023
@faustbrian
Copy link

@tobyzerner how far out do you think this is? I'm currently evaluating this package for a new project and this would be the main feature missing currently.

@tobyzerner
Copy link
Owner Author

I'm going to need this in one of my own projects soon, so I reckon I might set some time to work on it before January.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants