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
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,17 @@
7
7
8
8
This package allows you to filter, sort and include eloquent relations based on a request. The `QueryBuilder` used in this package extends Laravel's default Eloquent builder. This means all your favorite methods and macros are still available. Query parameter names follow the [JSON API specification](http://jsonapi.org/) as closely as possible.
9
9
10
+
## Caching foreign keys
11
+
Add this line to your composer.json file to cache foreign keys. This will allow the query builder to automatically detect foreign keys without having to make a database call.
12
+
These foreign keys will always be included in select statements, which will prevent a loss of potential relations.
13
+
```json
14
+
"scripts": {
15
+
"post-update-cmd": [
16
+
"@php artisan query-builder:cache-foreign-keys"
17
+
],
18
+
}
19
+
```
20
+
10
21
## Basic usage
11
22
12
23
### Filter a query based on a request: `/users?filter[name]=John`:
0 commit comments