panel icon indicating copy to clipboard operation
panel copied to clipboard

Replace Fractal with Laravel Data

Open alexevladgabriel opened this issue 9 months ago • 1 comments

This change ensure that Scramble docs can read the Request & Response (input/outputs), making easier for new developers to onboard over the current API implementations.

Replacing Fractal with Laravel Data comes with the following benefits:

  • Improvements over current maintability for long term
  • OpenAPI & Typescript Schema's (3rd party integrations)

This change will be backward compatible with Pterodactyl (1.X) for a mid-term period, to let developers adapt to the new ecosystem changes.


Current plan for development:

  1. Make our own Data class that extends the original. Add a setFractal(bool $value = true) and bool $isFractal property to it.
  2. Override the generation of the array return to put it into the same shape as a Fractal collection and resources if $isFractal is true.
  3. Replace all old array $params and returns with Data classes for the old api.
  4. Optionally create a new V2 api that has none of the Fractal shenanigans.

alexevladgabriel avatar Mar 02 '25 18:03 alexevladgabriel

Adding the package in #1065

lancepioch avatar Mar 07 '25 01:03 lancepioch