We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64cecf3 commit e0bf160Copy full SHA for e0bf160
1 file changed
src/Models/Request/CreateIndex.php
@@ -8,8 +8,20 @@
8
9
class CreateIndex implements RequestModel
10
{
11
- public function __construct(protected string $fieldName, protected ?array $fieldSchema = null)
+ protected string $fieldName;
12
+ protected ?array $fieldSchema;
13
+
14
+ public function __construct(string $fieldName, array|string $fieldSchema = null)
15
16
+ if (is_string($fieldSchema)) {
17
+ $this->fieldSchema = [
18
+ 'type' => $fieldSchema
19
+ ];
20
+ } else {
21
+ $this->fieldSchema = $fieldSchema;
22
+ }
23
24
+ $this->fieldName = $fieldName;
25
}
26
27
public function toArray(): array
0 commit comments