|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +return [ |
| 6 | + |
| 7 | + /* |
| 8 | + * By default the package will use the `include`, `filter`, `sort` |
| 9 | + * and `fields` query parameters as described in the readme. |
| 10 | + * |
| 11 | + * You can customize these query string parameters here. |
| 12 | + */ |
| 13 | + 'parameters' => [ |
| 14 | + 'include' => 'include', |
| 15 | + |
| 16 | + 'filter' => 'filter', |
| 17 | + |
| 18 | + 'sort' => 'sort', |
| 19 | + |
| 20 | + 'fields' => 'fields', |
| 21 | + |
| 22 | + 'append' => 'append', |
| 23 | + ], |
| 24 | + |
| 25 | + /* |
| 26 | + * Related model counts are included using the relationship name suffixed with this string. |
| 27 | + * For example: GET /users?include=postsCount |
| 28 | + */ |
| 29 | + 'count_suffix' => 'Count', |
| 30 | + |
| 31 | + /* |
| 32 | + * Related model exists are included using the relationship name suffixed with this string. |
| 33 | + * For example: GET /users?include=postsExists |
| 34 | + */ |
| 35 | + 'exists_suffix' => 'Exists', |
| 36 | + |
| 37 | + /* |
| 38 | + * By default the package will throw an `InvalidFilterQuery` exception when a filter in the |
| 39 | + * URL is not allowed in the `allowedFilters()` method. |
| 40 | + */ |
| 41 | + 'disable_invalid_filter_query_exception' => true, |
| 42 | + |
| 43 | + /* |
| 44 | + * By default the package will throw an `InvalidSortQuery` exception when a sort in the |
| 45 | + * URL is not allowed in the `allowedSorts()` method. |
| 46 | + */ |
| 47 | + 'disable_invalid_sort_query_exception' => true, |
| 48 | + |
| 49 | + /* |
| 50 | + * By default the package will throw an `InvalidIncludeQuery` exception when an include in the |
| 51 | + * URL is not allowed in the `allowedIncludes()` method. |
| 52 | + */ |
| 53 | + 'disable_invalid_includes_query_exception' => true, |
| 54 | + |
| 55 | + /* |
| 56 | + * By default, the package expects relationship names to be snake case plural when using fields[relationship]. |
| 57 | + * For example, fetching the id and name for a userOwner relation would look like this: |
| 58 | + * GET /users?fields[user_owner]=id,name |
| 59 | + * |
| 60 | + * Set this to `false` if you don't want that and keep the requested relationship names as-is and allows you to |
| 61 | + * request the fields using a camelCase relationship name: |
| 62 | + * GET /users?fields[userOwner]=id,name |
| 63 | + */ |
| 64 | + 'convert_relation_names_to_snake_case_plural' => true, |
| 65 | + |
| 66 | + /* |
| 67 | + * By default, the package expects relationship names to be snake case plural when using fields[relationship]. |
| 68 | + * For example, fetching the id and name for a userOwner relation would look like this: |
| 69 | + * GET /users?fields[user_owner]=id,name |
| 70 | + * |
| 71 | + * Set this to one of `snake_case`, `camelCase` or `none` if you want to enable table name resolution in addition to the relation name resolution |
| 72 | + * GET /users?include=topOrders&fields[orders]=id,name |
| 73 | + */ |
| 74 | + 'convert_relation_table_name_strategy' => false, |
| 75 | + |
| 76 | + /* |
| 77 | + * By default, the package expects the field names to match the database names |
| 78 | + * For example, fetching the field named firstName would look like this: |
| 79 | + * GET /users?fields=firstName |
| 80 | + * |
| 81 | + * Set this to `true` if you want to convert the firstName into first_name for the underlying query |
| 82 | + */ |
| 83 | + 'convert_field_names_to_snake_case' => false, |
| 84 | +]; |
0 commit comments