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.…