Menu

Set up Inertia Typegen in a Laravel 12 or 13 app that runs Scramble
📰

Set up Inertia Typegen in a Laravel 12 or 13 app that runs Scramble

DEV Community: laravel·Vagebond·1 day ago
#zFMEH7Jn
#devtolaravel#devto#dev#scramble#inertia
Long article (473 words) — no AI summary yet.
Reading 0:00
15s threshold

Inertia Typegen reads Scramble's OpenAPI document and writes a page type for each Inertia::render() call. This walkthrough adds it to a Laravel 12 or 13 app that already runs Scramble.

Check your versions

You need PHP 8.3+, Laravel 12 or 13 and inertia-laravel 2 or 3. On the JS side you need Node 22.18+ and Vite 6+. Scramble must be 0.13.49 or newer.

Why Scramble 0.13.49 or newer

Older Scramble versions are not supported. They have a security issue and a recursion bug. Every type the package writes comes from Scramble's document. Check your version first:

composer show dedoc/scramble

Enter fullscreen mode

Exit fullscreen mode

No Scramble yet? Install it as a development dependency:

composer require --dev dedoc/scramble

Enter fullscreen mode

Exit fullscreen mode

Without Scramble the package does nothing in production. That is fine.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.