Skip to content

v1.20.0

Choose a tag to compare

@yuriizee yuriizee released this 02 Aug 09:32
· 19 commits to main since this release

Added

  • PaginatedDataCollection — wraps a Laravel paginator into a {"data":[...],"meta":{...},"links":{...}} envelope, hydrating items through the same compiled hydrator as from().
    • HasLaravelIntegration::paginatedCollection() — opt-in entry point, e.g. ItemData::paginatedCollection(Item::paginate(20)).
    • Responsable + JsonSerializable — return it directly from a controller.
    • No new hard dependency: only Illuminate\Contracts\Pagination\* (already required via illuminate/contracts); illuminate/pagination is require-dev, needed only by the concrete paginator you pass in.
  • #[WrapIn] — wraps a single object's toResponse() payload under a key ({"data": {...}}), without touching toArray()/toJson() — the from(toArray()) round-trip stays intact.
  • toResponse() now accepts status and headers parameters.
  • Documentation: see Pagination & Response Envelope and #[WrapIn].