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

[4.x] REST API Globals return resolved relations #8555

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

martink635
Copy link
Contributor

This resolves: #8462

Calling the REST API for globals resolves any given relationship, so it behaves the same as other API endpoints (entries, …).

This is a breaking change since it changes the behaviour of the public facing API of Statamic.

@jasonvarga
Copy link
Member

It's a shame to have to make people wait until v5 for this fix, so we can make it opt in.

Throw this in your AppServiceProvider@boot:

\Statamic\Http\Resources\API\GlobalSetResource::withRelations();

In v5 can we make it the default behavior.

@jasonvarga jasonvarga merged commit 3bd7708 into statamic:4.x Aug 9, 2023
16 checks passed
@martink635 martink635 deleted the api-globals-with-relations branch August 9, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Statamic Globals REST API entries field returns array of ids
2 participants