We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a77e526 commit 7f108ddCopy full SHA for 7f108dd
src/Endpoint/Concerns/IncludesData.php
@@ -8,9 +8,20 @@
8
9
trait IncludesData
10
{
11
+ protected ?array $defaultInclude = null;
12
+
13
+ public function defaultInclude(array $include): static
14
+ {
15
+ $this->defaultInclude = $include;
16
17
+ return $this;
18
+ }
19
20
private function getInclude(Context $context): array
21
- if ($includeString = $context->request->getQueryParams()['include'] ?? null) {
22
+ if (
23
+ $includeString = $context->request->getQueryParams()['include'] ?? $this->defaultInclude
24
+ ) {
25
$include = $this->parseInclude($includeString);
26
27
$this->validateInclude(
0 commit comments