Skip to content
qubeejs/angular
3.8/API/SpatieResponseStrategy

SpatieResponseStrategy

ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.

Defined in: src/lib/strategies/spatie-response.strategy.ts:27

Response strategy for the Spatie Query Builder driver

Parses flat Laravel-style pagination responses (Spatie’s Query Builder is built on Laravel’s pagination):

{
"data": [...],
"current_page": 1,
"total": 100,
"per_page": 15,
"from": 1,
"to": 15,
...
}

The traversal algorithm (flat response[options.X] lookups) is inherited from AbstractFlatResponseStrategy; this class exists so DriverEnum.SPATIE resolves to a distinct identity at the DI layer even though the parsing logic is shared with the plain Laravel driver.

https://spatie.be/docs/laravel-query-builder

  • AbstractFlatResponseStrategy

new SpatieResponseStrategy(): SpatieResponseStrategy

SpatieResponseStrategy

AbstractFlatResponseStrategy.constructor

paginate<T>(response, options): PaginatedCollection<T>

Defined in: src/lib/strategies/abstract-flat-response.strategy.ts:35

Parse a flat-envelope pagination response into a PaginatedCollection

T extends IPaginatedObject

Record<string, any>

The raw API response object

ResponseOptions

The response key name configuration

PaginatedCollection<T>

A typed PaginatedCollection instance

AbstractFlatResponseStrategy.paginate