Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Oi Laravel Ts Laravel Package

oi-lab/oi-laravel-ts

Generates TypeScript interfaces from Laravel Eloquent models, including relationships, casts, PHPDoc types, and DataObjects. Supports watch mode, namespace filtering, UUID/ULID key typing, and optional JSON-LD output.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Frontend-Backend Type Safety: Eliminates runtime type mismatches between Laravel models and TypeScript frontend by auto-generating strongly-typed interfaces, reducing API contract drift.
  • Developer Productivity: Accelerates frontend development by providing IDE autocomplete and type hints for all Eloquent models, relationships, and custom casts without manual maintenance.
  • API Contract Management: Serves as a single source of truth for API schemas, ensuring consistency between backend models and frontend types.
  • Build vs. Buy Decision: Justifies avoiding custom solutions or third-party tools (e.g., manual OpenAPI specs or Swagger) for Laravel-to-TypeScript synchronization.
  • Use Cases:
    • Full-stack Laravel + Vue/React/Inertia.js applications.
    • Microservices with Laravel backends and TypeScript-heavy frontends.
    • Projects requiring JSON-LD or complex data structures (e.g., e-commerce, SaaS platforms).
    • Teams prioritizing developer experience over minimal setup (e.g., startups, agencies).

When to Consider This Package

  • Adopt if:

    • Your team uses Laravel + TypeScript and struggles with manual API documentation or type synchronization.
    • You have 50+ Eloquent models with relationships/casts, making manual interface generation unsustainable.
    • Your frontend relies on Inertia.js, API clients, or GraphQL and needs accurate Laravel model types.
    • You use custom casts (DataObjects/Value Objects) and want their types auto-generated.
    • Your stack includes UUID/ULID primary keys, complex casts, or JSON-LD schemas.
  • Look elsewhere if:

    • Your project is small-scale (<20 models) or uses minimal TypeScript.
    • You prefer OpenAPI/Swagger for API contracts (this package focuses on Eloquent models, not full API specs).
    • Your backend uses non-Laravel PHP (Symfony, Lumen, etc.).
    • You need runtime type validation (consider spatie/laravel-api-resources or zircote/swagger-php).
    • Your team lacks PHP/TypeScript expertise to configure or debug the generator.

How to Pitch It (Stakeholders)

For Executives:

*"This package automates the creation of TypeScript interfaces for all Laravel models, cutting frontend development time by 30% and eliminating API contract mismatches. For a $500/year MIT-licensed solution, we gain:

  • Faster development: No manual type sync between backend and frontend.
  • Fewer bugs: TypeScript IDE support catches errors early.
  • Scalability: Handles complex relationships/casts automatically.
  • Future-proofing: Integrates with Inertia.js, JSON-LD, and custom data structures. Example: A 100-model Laravel app would save 2–3 dev weeks/year on type maintenance."*

For Engineers:

*"This replaces manual .d.ts files or Swagger docs with a zero-maintenance solution that:

  • Auto-generates TypeScript interfaces for Eloquent models, relationships, and casts.
  • Supports UUIDs, DataObjects, and JSON-LD out of the box.
  • Watches for changes: Run php artisan oi:gen-ts --watch to auto-update types.
  • Configurable: Exclude namespaces, add custom props, or extend interfaces. Use case: If you’re using Inertia.js or a typed API client, this ensures your frontend types always match your Laravel models—no more Property 'x' does not exist on type 'Y' errors."*

For PMs:

*"This is a force multiplier for full-stack teams:

  • Reduces tech debt: No more out-of-sync .d.ts files.
  • Enables faster iterations: Frontend devs get instant type hints for new models.
  • Low risk: MIT license, minimal setup, and comprehensive docs. Trade-off: Requires PHP 8.2+ and Laravel 11+. Worth it if your stack is TypeScript-heavy and Laravel-driven."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nasirkhan/laravel-sharekit
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony