v1.0.0-beta.6
Pre-release
Pre-release
⚠️ Breaking Changes
- Change
Resource\Paginatable::paginate()signature to accept the resolved
offset and limit integers (plus the request context) and return the page of
results instead of mutating the query in place - New contract for custom
Paginationimplementations:- Add
paginate(object $query, Context $context): Pagemethod which should
return a page of results - Remove
metaandlinksmethods; set this data inpaginatevia the
Contextobject
- Add
Resource\\Listableimplementations must now providedefaultSort()and
pagination()methods so defaults can be reused when listing related data- Refactor
Serializerso it is instantiated without aContextand expects
the resource context to be provided toaddPrimary()/addIncluded()
Added
- Add cursor pagination support via
Endpoint\Index::cursorPaginate()and the
Resource\CursorPaginatablecontract, following the
ethanresnick/cursor-paginationJSON:API profile - Allow exceptions to attach
metaandlinksmembers to the error response - Add
Context::$documentMetaandContext::$documentLinksasArrayObject
instances to allow callbacks to add meta information to the response document - Support JSON:API relationship URLs via the
Showendpoint, adding automatic
self/relatedlinks, and paginated/filterable/sortable to-many responses
when the related resource isListable - Allow the
Updateendpoint to handlePATCH/POST/DELETErequests to
relationship URLs and return the updated relationship document - Implement the
Resource\Attachablecontract and addToMany::attachable(),
validateAttach(), andvalidateDetach()helpers for controlling
relationship mutation endpoints with attach/detach hooks - Introduce
Endpoint\ResourceEndpointandEndpoint\RelationshipEndpointso
endpoints can contribute relationship and resource links during serialization