Skip to content

Conversation

@irabbi360
Copy link

What is this PR doing?

This PR adds documentation for the new JsonApiResource feature introduced in Laravel 12.45.0. It includes:

  • Instructions on how to generate a JSON:API resource using the --json-api flag.

  • An explanation of how the JsonApiResource automatically structures the JSON output to adhere to the JSON:API specification (wrapping attributes, handling id and type).

  • A code example showing a basic implementation and the resulting JSON structure.

Why is this change being made?

With the release of Laravel 12.45.0, developers now have native support for creating JSON:API compliant resources. However, this feature is not yet mentioned in the official Eloquent: API Resources documentation. Adding this section ensures that the documentation stays up-to-date with the latest framework features and helps developers implement the specification correctly.

Reference
This documentation corresponds to the framework changes in:

Framework PR: laravel/framework#57571

Release: Laravel v12.45.0

What is this PR doing?

This PR adds documentation for the new JsonApiResource feature introduced in Laravel 12.45.0. It includes:

Instructions on how to generate a JSON:API resource using the --json-api flag.

An explanation of how the JsonApiResource automatically structures the JSON output to adhere to the JSON:API specification (wrapping attributes, handling id and type).

A code example showing a basic implementation and the resulting JSON structure.

Why is this change being made?
With the release of Laravel 12.45.0, developers now have native support for creating JSON:API compliant resources. However, this feature is not yet mentioned in the official Eloquent: API Resources documentation. Adding this section ensures that the documentation stays up-to-date with the latest framework features and helps developers implement the specification correctly.

Reference
This documentation corresponds to the framework changes in:

Framework PR: laravel/framework#57571

Release: Laravel v12.45.0
@taylorotwell taylorotwell marked this pull request as draft January 11, 2026 18:19
@taylorotwell
Copy link
Member

Mainly considering this a beta feature for now that will be stable on Laravel 13.

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.

2 participants