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
Pagination
implementations:- Add
paginate(object $query, Context $context): Page
method which should
return a page of results - Remove
meta
andlinks
methods; set this data inpaginate
via the
Context
object
- Add
Resource\\Listable
implementations must now providedefaultSort()
and
pagination()
methods so defaults can be reused when listing related data- Refactor
Serializer
so it is instantiated without aContext
and expects
the resource context to be provided toaddPrimary()
/addIncluded()
Added
- Add cursor pagination support via
Endpoint\Index::cursorPaginate()
and the
Resource\CursorPaginatable
contract, following the
ethanresnick/cursor-pagination
JSON:API profile - Allow exceptions to attach
meta
andlinks
members to the error response - Add
Context::$documentMeta
andContext::$documentLinks
asArrayObject
instances to allow callbacks to add meta information to the response document - Support JSON:API relationship URLs via the
Show
endpoint, adding automatic
self
/related
links, and paginated/filterable/sortable to-many responses
when the related resource isListable
- Allow the
Update
endpoint to handlePATCH
/POST
/DELETE
requests to
relationship URLs and return the updated relationship document - Implement the
Resource\Attachable
contract and addToMany::attachable()
,
validateAttach()
, andvalidateDetach()
helpers for controlling
relationship mutation endpoints with attach/detach hooks - Introduce
Endpoint\ResourceEndpoint
andEndpoint\RelationshipEndpoint
so
endpoints can contribute relationship and resource links during serialization