null becomes mixed on the PHP DTO
Laravel writes null. TypeScript types null. The PHP draft uses mixed. CSV prints headers with an empty row.

Null property values stay in the paste. On the JSON converter the four formats still do not type them the same way. Conversion stays in the browser.
{"name":null,"age":null,"meta":null}
Laravel writes null for each key. TypeScript types each field as null. The PHP DTO types each property as mixed. CSV prints the headers and leaves an empty row underneath.
Null is not a nested object
When meta holds {"active":true}, TypeScript emits interface Meta and the field is meta: Meta. The PHP DTO still types that nest as public array $meta with no child class. When meta is JSON null, there is no nest to name. TypeScript keeps null. PHP uses mixed.
Missing key vs null value
A missing key is assigned with ?? null in the PHP constructor, even on public int $id. An explicit JSON null is a present key whose value is null, and that property is drafted as mixed on the PHP class. The class name remains DataTransferObject.
Treat the output as a draft. Rename the class, and decide whether mixed or a narrower null type belongs in the code you ship.
Guide: https://kepttools.com/guides/json-to-typescript-php-dto-laravel
Comments
Join the discussionThe missing key vs null distinction is a real gotcha in PHP. With a decoded array, isset($data['meta']) returns false when the value is null, so it treats a present null key like a missing one. array_key_exists('meta', $data) tells them apart. Also worth noting that mixed already includes null, so if a field is only ever a value or null, a nullable type such as ?array (or array|null in PHP 8) is usually a tighter choice than mixed.
Thanks Shahabaz — that distinction matters a lot in PHP.
isset() collapsing a present null into “missing” is exactly why array_key_exists() is the safer check on decoded arrays. And agreed on the draft: KeptTools types an explicit JSON null as mixed, which already includes null. For a field that is only a value or null, tightening that to something like ?array / array|null before shipping is usually the better move. The converter output is a starting draft, not the final type contract.



