You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both `parseSingle` and `parseMultiple` return a `Result` object with the following methods available:
102
102
@@ -122,7 +122,7 @@ Returns an array of meta provider objects. Each of these objects provide a speci
122
122
**cleanup($cleanup) => $this:**
123
123
If true, the resulting array will get cleaned up from unintentionally added relations. Defaults to the config `apihandler.cleanup_relations` which defaults to `false`.
124
124
125
-
####Filtering
125
+
####Filtering
126
126
Every query parameter, except the predefined functions `_fields`, `_with`, `_sort`, `_limit`, `_offset`, `_config` and `_q`, is interpreted as a filter. Be sure to remove additional parameters not meant for filtering before passing them to `parseMultiple`.
127
127
128
128
```
@@ -157,7 +157,7 @@ Respectively the `not-in` suffix:
157
157
```
158
158
159
159
160
-
#####Suffixes
160
+
#####Suffixes
161
161
Suffix | Operator | Meaning
162
162
------------- | ------------- | -------------
163
163
-lk | LIKE | Same as the SQL `LIKE` operator
@@ -170,13 +170,13 @@ Suffix | Operator | Meaning
170
170
-gt | > | Greater than
171
171
-not | != | Not equal to
172
172
173
-
####Sorting
173
+
####Sorting
174
174
Two ways of sorting, ascending and descending. Every column which should be sorted descending always starts with a `-`.
175
175
```
176
176
/api/books?_sort=-title,created_at
177
177
```
178
178
179
-
####Fulltext search
179
+
####Fulltext search
180
180
Two implementations of full text search are supported.
181
181
You can choose which one to use by changing the `fulltext` option in the config file to either `default` or `native`.
182
182
@@ -204,7 +204,7 @@ Each result will also contain a `_score` column which allows you to sort the res
204
204
205
205
You can adjust the name of this column by modifying the `fulltext_score_column` setting in the config file.
206
206
207
-
####Limit the result set
207
+
####Limit the result set
208
208
To define the maximum amount of datasets in the result, use `_limit`.
209
209
```
210
210
/api/books?_limit=50
@@ -215,7 +215,7 @@ To define the offset of the datasets in the result, use `_offset`.
215
215
```
216
216
Be aware that in order to use `offset` you always have to specify a `limit` too. MySQL throws an error for offset definition without a limit.
217
217
218
-
####Include related models
218
+
####Include related models
219
219
The api handler also supports Eloquent relationships. So if you want to get all the books with their authors, just add the authors to the `_with` parameter.
220
220
```
221
221
/api/books?_with=author
@@ -239,7 +239,7 @@ This is necessary for security reasons, so that only real relation methods can b
239
239
240
240
***Note:*** Whenever you limit the fields with `_fields` in combination with `_with`. Under the hood the fields are extended with the primary/foreign keys of the relation. Eloquent needs the linking keys to get related models.
241
241
242
-
####Include meta information
242
+
####Include meta information
243
243
It's possible to add additional information to a response. There are currently two types of counts which can be added to the response headers.
244
244
245
245
The `total-count` which represents the count of all elements of a resource or to be more specific, the count on the originally passed query builder instance.
@@ -256,7 +256,7 @@ Config | Header
256
256
meta-total-count | Meta-Total-Count
257
257
meta-filter-count | Meta-Filter-Count
258
258
259
-
####Use an envelope for the response
259
+
####Use an envelope for the response
260
260
By default meta data is included in the response header. If you want to have everything togheter in the response body you can request a so called "envelope"
261
261
either by including `response-envelope` in the `_config` parameter or by overriding the default `config.php` of the package.
0 commit comments