Skip to content

TypeScript types,direct fromLaravel

Supports:Models

One Artisan command turns your Eloquent models, Enums, FormRequests & API Resources into fully-typed TypeScript. AST parsing · Zod schemas · CI safety gates.

Open source · MITLaravel 11–13PHP 8.2+CI & Pest verified
live generation php artisan typescript:generate
PHP User.phpsource
1<?php
2
3#[TypeScript(includeRelations: ['posts'])]
4class User extends Model
5{
6 protected $fillable = [
7 'name', 'email', 'role',
8 ];
9
10 protected $casts = [
11 'role' => UserRole::class,
12 ];
13}
typegen
TS User.ts auto
1
scroll
The problem we solve

Stop maintaining types twice.

Before TypeGen, every model change required a manual TypeScript update. One Artisan command eliminates that forever.

User.ts manual❌ error-prone
1// ⚠ maintained by hand — drifts silently
2
3interface User {
4 id: number;
5− role: string; // ❌ wrong type!
6− // created_at: missing…
7− // posts: ???
8}
User.ts typegen✓ always correct
1// AUTO-GENERATED by laravel-typegen
2
3export interface User {
4+ readonly id: number;
5+ role: UserRole; // ✓ enum type
6+ readonly created_at: string | null;
7+ posts?: Relation<Post[]>;
8}
9
10+export type UserRole = 'admin' | 'member';
Get started — it's free

One command. Zero configuration. Ships immediately.

Coming Soon · Cloud Add-On for Teams

TypeGen Guard: Automated PR Drift & Breaking-Change Bot

Zero-config GitHub App for Laravel + Inertia teams. Automatically runs --skip-db-check on every Pull Request, blocks broken frontend contracts, and posts visual TypeScript diff tables before merge.

✓ Zero CI YAML setup✓ Sticky PR diff comments✓ Breaking-change alerts
terminal
▌
Open Source · Free Forever · MIT

Stop the
type drift.
Start shipping.

Install in under 60 seconds. Save hours every sprint. Never manually update a TypeScript type again.

CI verified Laravel 11–13 PHP 8.2+