# status becomes Statu. first-name keeps the hyphen

`status` does not become an interface named `Status`. The converter drops one trailing `s` from the key, then Pascal-cases what is left. `status` becomes `Statu`. `items` becomes `Item`.

```ts
export interface Root {
  status: Statu[];
}

export interface Statu {
  code: string;
}
```

That is the TypeScript draft for `{"status":[{"code":"ok"}]}` from the [JSON converter](https://kepttools.com/json-converter). The PHP DTO types the same field as `public array $status`. It does not create a class named `Statu`. Conversion runs in the browser.

## A hyphen is copied, not cleaned

Laravel can quote a hyphen. For `{"first-name":"Ada","role":"engineer"}` the array entry is `'first-name' => 'Ada'`.

TypeScript writes the key as it arrived:

```ts
export interface Root {
  first-name: string;
  role: string;
}
```

The PHP DTO does the same:

```php
public string $first-name;
```

The constructor line is `$this->first-name = $data['first-name'] ?? null`. The class name stays `DataTransferObject`. A nested object on that class is `array`, not a second class. A missing key is still assigned with `?? null`, including on a property declared `public int $id`.

## Treat the output as a draft

Rename the class before it ships. Replace a hyphen key with a legal identifier. Check child interface names that came from plural keys. If the paste needs repair first, use the [JSON formatter](https://kepttools.com/json-formatter). A trailing comma clears every format.

Guide: <https://kepttools.com/guides/json-to-typescript-php-dto-laravel>
