3.8/Drivers/Spatie Driver
Spatie Driver
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Targets Spatie Laravel Query Builder.
Configure
Section titled “Configure”import { DriverEnum, provideNgQubee } from 'ng-qubee';
bootstrapApplication(AppComponent, { providers: [provideNgQubee({ driver: DriverEnum.SPATIE })]});Wire format
Section titled “Wire format”| Concern | Output |
|---|---|
| Filters | filter[field]=value |
| Per-model fields | fields[users]=id,email |
| Includes | include=profile,posts |
| Sort | sort=-created_at,name (- = DESC) |
| Pagination | limit=15&page=1 |
Supported features
Section titled “Supported features”addFilter, addFields, addIncludes, addSort, setLimit, setPage and their delete counterparts.
Unsupported features
Section titled “Unsupported features”addFilterOperator/deleteOperatorFilters→UnsupportedFilterOperatorErroraddSelect/deleteSelect→UnsupportedSelectErrorsetSearch/deleteSearch→UnsupportedSearchError
Customising request keys
Section titled “Customising request keys”Each query parameter name is configurable via IConfig.request:
provideNgQubee({ driver: DriverEnum.SPATIE, request: { filters: 'custom-filter-key', fields: 'custom-fields-key', includes: 'custom-includes-key', limit: 'per_page', page: 'pg', sort: 'orderBy' }});Defaults match Spatie’s documented conventions.
Response shape
Section titled “Response shape”{ "data": [...], "current_page": 1, "per_page": 15, "total": 100, "from": 1, "to": 15, "first_page_url": "...", "last_page": 7, "last_page_url": "...", "next_page_url": "...", "prev_page_url": null}