laravel-typescript icon indicating copy to clipboard operation
laravel-typescript copied to clipboard

rule `present` in array items validation

Open qunabu opened this issue 2 years ago • 1 comments

Hi. First of all thanks for such a great package.

I've come accross issue

If i have request with the following rules

 return [
      'config' => ['required', 'array'],
      'config.*.key' => ['required', 'string'],
      'config.*.value' => ['present', 'nullable']
  ];

the result of transformation is

export interface ConfigUpdateRequest {
    config: Array<{
        key: string;
        value: present | null;
    }>;
}

which is incorrect because present is not typescript built-in type nor interface

qunabu avatar Mar 10 '22 15:03 qunabu

seems like this rule is missing in the CONTROL_KEYS const in RequestGenerator.php#L21

qunabu avatar Mar 10 '22 16:03 qunabu