Product Decisions This Supports
- Cross-platform type safety: Accelerates frontend-backend alignment by auto-generating strongly-typed models (TypeScript/Dart/Kotlin/Swift) from Laravel Eloquent models, reducing manual API contract maintenance.
- Developer velocity: Eliminates repetitive boilerplate for frontend teams by auto-syncing backend schema changes (e.g., new fields, relationships) to frontend types.
- Build vs. buy: Justifies buying this package over custom solutions for teams with multi-language clients (e.g., mobile + web) or frequent schema evolution (e.g., startups, SaaS products).
- Roadmap prioritization: Enables gradual adoption of typed APIs—start with one language (e.g., TypeScript) and expand to others as needed.
- Use cases:
- Headless CMS or composable architectures where backend models drive multiple frontend experiences.
- Microservices needing shared type definitions across services.
- Legacy systems migrating to typed APIs without rewriting contracts.
When to Consider This Package
Adopt if:
- Your team uses Laravel + multi-language clients (e.g., React + Flutter) and struggles with API drift.
- You frequently update database schemas and want to propagate changes automatically.
- Your frontend relies on TypeScript/Dart/Kotlin/Swift and could benefit from zero-trust API contracts (no manual
.d.ts/.kt files).
- You prioritize developer experience over minimal setup (e.g., willing to add a
php artisan schematics:generate step to CI/CD).
Look elsewhere if:
- You only serve a single frontend language (e.g., pure React/TypeScript) and already use tools like Laravel Sanctum + OpenAPI.
- Your schema is static (rare updates) and manually maintained types suffice.
- Your stack is non-Laravel (e.g., Django, Node.js) or uses GraphQL (where tools like GraphQL Codegen are more mature).
- You need real-time sync (this is a build-time tool; consider WebSockets for live updates).
How to Pitch It (Stakeholders)
For Executives:
"This package cuts API contract maintenance in half by auto-generating type-safe models for [TypeScript/Dart/Kotlin/Swift] directly from Laravel. For every backend schema change, we eliminate manual frontend updates—saving [X] hours/month and reducing bugs from misaligned APIs. Ideal for [product name], where [multi-language clients/microservices] slow down development. Low-risk: runs in CI/CD as a one-time generation step."
For Engineering:
*"Artisan Schematics replaces ad-hoc .d.ts files with auto-generated, always-in-sync types for all Eloquent models and enums. Key wins:
- Supports all Eloquent relationships (even complex ones like
hasOneThrough).
- Zero manual work: Just run
php artisan schematics:generate—it handles dependencies recursively.
- Extensible: Need Go or Rust support? Add a generator in minutes.
- Battle-tested: MIT-licensed with a comprehensive test suite.
Tradeoff: Adds a dev dependency but eliminates a major toil source. Perfect for teams tired of ‘API changed, frontend broke’ cycles."*
For Frontend Teams:
*"No more guessing API shapes or chasing backend changes. This tool auto-generates your TypeScript/Dart/Kotlin types from Laravel, so your IDE knows exactly what the backend returns. Example:
// Auto-generated from Laravel's `User` model:
interface User {
id: number;
name: string;
posts: Post[]; // Includes nested relationships!
role: 'admin' | 'user'; // Enums too!
}
Just run npm run generate-schematics (or your CI step), and your types stay in sync forever."