{
  "id": 20849977,
  "title": "first-name keeps the hyphen in the draft",
  "url": "https://urgent.news/2026/11/20/first-name-keeps-the-hyphen-in-the-draft",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-20T04:08:46.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ameenusman/first-name-keeps-the-hyphen-in-the-draft-31f3"
  },
  "original_language": "en",
  "account": "A key named \"first-name\" functions correctly in JSON format. However, when converted to Laravel drafts, the hyphenated identifier behaves differently. Laravel encloses the hyphenated key in quotes, resulting in valid array syntax, such as \"first-name\" = Ada. TypeScript and PHP Data Transfer Objects (DTOs) retain the hyphen in the identifier, displaying it as first-name: string; in TypeScript and public string $first-name in the PHP class. This draft is not intended for production use, but if the hyphen is not permissible in your language, it is advisable to rename the field before deployment.\n\nThe issue of a trailing comma, like { a:1,}, leads to parse errors and should be addressed by repairing the JSON formatter before conversion. Nested objects under the meta key become an interface named Meta in TypeScript and a public array $meta in the PHP class. The key itself is copied into the draft, irrespective of the hyphen. For further assistance, refer to the guide at https://kepttools.com/guides/json-to-typescript-php-dto-laravel.",
  "summary": "A key named first-name looks fine in JSON. The drafts do not treat it the same way. On the JSON converter , Laravel quotes it and stays valid. TypeScript and the PHP DTO keep the hyphen in the identifier. Conversion runs in the browser. Nothing is uploaded. The sample { \"first-name\" : \"Ada\" , \"role\" : \"engineer\" } Laravel prints valid array syntax: 'first-name' => 'Ada' . TypeScript emits…",
  "key_points": [
    "First-name key functions correctly in JSON format.",
    "Laravel encloses hyphenated identifier in quotes.",
    "TypeScript retains hyphen in first-name identifier."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}