Skip to content

Handle related resource URLs #3

Open
@tobyzerner

Description

@tobyzerner

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions