A whole number and a decimal do not land the same way on the PHP DTO. On the JSON converter , paste 1 and the property is typed int . Paste 1.5 and it is typed float . TypeScript types both as number . Conversion runs in the browser. Nothing is uploaded.
Same JSON, split types
JSON itself does not separate int from float the way PHP does. The draft still does on the PHP class. That is useful when you want a strict property, and easy to miss when you expected one TypeScript-style number everywhere.
The class name stays DataTransferObject . Treat the output as a starting point. Rename the class, and decide whether int , float , or a wider type belongs in the code you ship.
Keep this separate from a scalar list
A root list such as [1,"a",true,null] is a different case. Laravel prints a PHP list of those four values. TypeScript prints export interface Root {} with nothing inside, because the first item is a number, not an object.…