Replace the Fractal transformers with laravel-data wire objects - #2521
Open
lancepioch wants to merge 3 commits into
Open
Replace the Fractal transformers with laravel-data wire objects#2521lancepioch wants to merge 3 commits into
lancepioch wants to merge 3 commits into
Conversation
lancepioch
marked this pull request as ready for review
August 18, 2026 05:39
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Open
lancepioch
force-pushed
the
api/laravel-data-migration
branch
2 times, most recently
from
August 18, 2026 12:51
954f1ae to
14d1ece
Compare
Adds an owned envelope layer under app/Data/Api: ApiResource is the laravel-data
base for the wire objects, Envelope renders the panel's {object, attributes}
format with includes nested under relationships, IncludeContext carries the
request and include paths with the ported authorize checks, and PanelResponse is
the drop-in for the injected Fractal wrapper with League's include parsing,
pagination, and addMeta semantics reproduced exactly. Every application and
client transformer now has a Data class, and every controller call site runs
through the new layer, verified by the contract freeze suite with zero snapshot
changes plus the pre-existing Integration suites.
The old transformers, the Fractal extension classes, and the deprecated egg
config and script and server transfer include declarations are intentionally
still present; teardown happens in the next layer. Requesting one of those three
includes used to 500 because they were declared but never implemented, and it is
now silently ignored like any other unknown include.
The concrete Data classes are final now, which makes their new static calls in fromModel provably safe, PluginData documents its panels element type, and the paginated branch of PanelResponse hands Envelope::collection the paginator's items directly since the paginator contract itself is not iterable.
Sealing the Data classes activated self_static_accessor and the brace placement rules, so new static became new self and the formatting nits are settled.
lancepioch
force-pushed
the
api/laravel-data-migration
branch
from
August 18, 2026 13:33
c677c74 to
f844c01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second layer of the API freeze stack, on top of #2520. This replaces the League Fractal transformer pipeline with laravel-data backed wire objects behind an envelope layer we own. app/Data/Api holds the four core pieces: ApiResource is the laravel-data base class, Envelope renders the panel's {object, attributes} format with includes nested under relationships, IncludeContext carries the request and include paths along with the ported authorize checks, and PanelResponse is a drop-in for the injected Fractal wrapper that reproduces League's include parsing, recursion trimming, pagination block with its empty links object, and Fractalistic's addMeta union semantics. Every application and client transformer now has a corresponding Data class and every controller call site runs through the new layer, while the old transformers and Fractal extensions stay in place untouched so the next layer can delete them in one sweep.
The proof is the test fixture suite from the layer below: all 75 snapshots pass with zero changes, and the pre-existing application and client Integration suites stay green. The transformer quirks are preserved exactly, including the egg variable resource key mismatch, the plural databases include key, and the deprecated duplicate payload fields. One deliberate behavior change: the egg config and script includes and the server transfer include were declared but never implemented, so requesting them used to 500; they are now silently ignored like any other unknown include.