lepikhinb / laravel-typescript

MIT License
387 stars 46 forks source link

rule `present` in array items validation #12

Open qunabu opened 2 years ago

qunabu commented 2 years ago

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 commented 2 years ago

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