Skip to content
TS
Laravel TypeGen
0%
v2.2.3 — What's new

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.3+54 tests passing
live generation php artisan typegen:generate
PHP User.phpsource
1<?php
2
3class User extends Model
4{
5 protected $fillable = [
6 'name', 'email',
7 '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// ✦ generated by typegen:generate
2
3export interface User {
4+ id: number;
5+ role: UserRole; // ✓ enum type
6+ created_at: string;
7+ posts?: Post[];
8}
9
10+export type UserRole = 'admin' | 'member';
Get started — it's free

One command. Zero configuration. Ships immediately.

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.

54 tests Laravel 11–13 PHP 8.3+