PHPackages                             pentacore/laravel-typefinder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pentacore/laravel-typefinder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pentacore/laravel-typefinder
============================

Auto-generate TypeScript type definitions from Laravel Models, Enums, Casts, and Requests.

4.2.3(1mo ago)1588↓100%[9 PRs](https://github.com/pentacore/Laravel-Typefinder/pulls)MITPHPPHP ^8.3CI passing

Since Apr 14Pushed 2w agoCompare

[ Source](https://github.com/pentacore/Laravel-Typefinder)[ Packagist](https://packagist.org/packages/pentacore/laravel-typefinder)[ Docs](https://github.com/pentacore/laravel-typefinder)[ RSS](/packages/pentacore-laravel-typefinder/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (10)Versions (29)Used By (0)

Laravel Typefinder
==================

[](#laravel-typefinder)

[![Tests](https://github.com/pentacore/Laravel-Typefinder/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/pentacore/Laravel-Typefinder/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/ec9d6414e35b37db7104a21263252a7f62e75d26677d1c4fc4193ff8223a5db6/68747470733a2f2f636f6465636f762e696f2f6769746875622f70656e7461636f72652f4c61726176656c2d5479706566696e6465722f67726170682f62616467652e7376673f746f6b656e3d515a47554a3858463944)](https://codecov.io/github/pentacore/Laravel-Typefinder)[![License](https://camo.githubusercontent.com/8aaf22a4857a1406600b2d098cbea5558299cc623bccf9afac64298156cab0c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70656e7461636f72652f4c61726176656c2d5479706566696e646572)](LICENSE)[![semantic-release](https://camo.githubusercontent.com/966696fd97c35ab168f6cebdc7da4c2416f97a55847dbe47fa0cc373601e9a62/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73656d616e7469632d2d72656c656173652d636f6e76656e74696f6e616c2d6531303037393f6c6f676f3d73656d616e7469632d72656c65617365266c6f676f436f6c6f723d7768697465)](https://github.com/semantic-release/semantic-release)

[![Packagist Version](https://camo.githubusercontent.com/ea6cffef94c3ea2c92c049eb08e3d946b260a6e026da6451b252ecaef5f4e684/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70656e7461636f72652f6c61726176656c2d7479706566696e6465723f6c6162656c3d636f6d706f736572266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/pentacore/laravel-typefinder)[![Packagist Downloads](https://camo.githubusercontent.com/c38e11308d44a259cafd79b3ca758a2d4a8e3c1c501311f83e0237867bf4963a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70656e7461636f72652f6c61726176656c2d7479706566696e6465723f6c6162656c3d646f776e6c6f616473266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/pentacore/laravel-typefinder/stats)[![NPM Version](https://camo.githubusercontent.com/f620302fa81d2f3ed7a8f4e7c6fbd9f4a2b82ab8a8779e81d68d93b1c23b41fe/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f25343070656e7461636f7265253246766974652d706c7567696e2d6c61726176656c2d7479706566696e6465723f6c6162656c3d6e706d266c6f676f3d6e706d266c6f676f436f6c6f723d7768697465)](https://www.npmjs.com/package/@pentacore/vite-plugin-laravel-typefinder)[![NPM Downloads](https://camo.githubusercontent.com/d10823b344afb16509636b8431e1d53e9498e79632c3323a780ded5ed32029dc/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f25343070656e7461636f7265253246766974652d706c7567696e2d6c61726176656c2d7479706566696e6465723f6c6162656c3d646f776e6c6f616473266c6f676f3d6e706d266c6f676f436f6c6f723d7768697465)](https://www.npmjs.com/package/@pentacore/vite-plugin-laravel-typefinder)

Laravel Typefinder auto-generates TypeScript type definitions (`.d.ts` files) from your Laravel application. It introspects Eloquent models, backed enums, Form Requests, API Resources, Inertia controllers, broadcast events, and pivot tables to produce accurate, always-fresh types — no manual maintenance required. Ships with opt-in attributes (`#[TypefinderOverrides]`, `#[TypefinderWriteShape]`, `#[TypefinderResource]`, `#[TypefinderPage]`, `#[TypefinderBroadcast]`, `#[TypefinderCast]`, `#[TypefinderIgnore]`) for the cases where static inference needs a nudge, plus a runtime facade for registering types for third-party casts.

Contents
--------

[](#contents)

- [Packages](#packages)
- [At a glance](#at-a-glance)
- [Quick start](#quick-start)
- [Supported matrix](#supported-matrix)
- [Documentation](#documentation)
- [Development](#development)
- [Contributing](#contributing)
- [Security](#security)
- [License](#license)

Packages
--------

[](#packages)

PackageInstall[`pentacore/laravel-typefinder`](packages/laravel-typefinder/)`composer require pentacore/laravel-typefinder`[`@pentacore/vite-plugin-laravel-typefinder`](packages/vite-plugin-laravel-typefinder/)`npm i -D @pentacore/vite-plugin-laravel-typefinder`At a glance
-----------

[](#at-a-glance)

You write this:

```
// app/Models/Post.php
class Post extends Model
{
    protected $casts = [
        'status' => PostStatus::class,
        'published_at' => 'datetime',
    ];

    public function author(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
```

Typefinder emits this:

```
// resources/js/typefinder/models/Post.d.ts
import type { PostStatus } from '../enums';
import type { User } from './User';

export type Post = {
  id: number;
  title: string;
  status: PostStatus;
  published_at: string | null;
  author?: User | null;
};

export type PostCreate = { title: string; status: PostStatus; published_at?: string | null };
export type PostUpdate = { title?: string; status?: PostStatus; published_at?: string | null };
```

No decorators, no manual schemas — it reads your migrations, `$casts`, and relationships directly.

Quick start
-----------

[](#quick-start)

**1. Install the Composer package:**

```
composer require pentacore/laravel-typefinder
```

**2. Register the Vite plugin** (`vite.config.js`):

```
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import typefinder from '@pentacore/vite-plugin-laravel-typefinder';

export default defineConfig({
    plugins: [
        laravel({ input: ['resources/js/app.js'] }),
        typefinder(),
    ],
});
```

**3. Generate types:**

```
php artisan typefinder:generate
```

Types are written to `resources/js/typefinder/` by default. The Vite plugin re-runs generation automatically on HMR file changes.

Supported matrix
----------------

[](#supported-matrix)

Every cell below is exercised in CI on every push and PR.

PHP 8.3PHP 8.4PHP 8.5Laravel 11✅✅—Laravel 12✅✅✅Laravel 13✅✅✅Documentation
-------------

[](#documentation)

Full documentation for each package:

- [packages/laravel-typefinder/README.md](packages/laravel-typefinder/README.md) — configuration, every generated category (models / enums / requests / resources / pivots / pages / broadcasting / helpers), the full attribute reference, the third-party cast registry, and the artisan commands (`typefinder:generate`, `typefinder:watch`) with flags (`--check`, `--json`, `--debug`, `--only=`).
- [packages/vite-plugin-laravel-typefinder/README.md](packages/vite-plugin-laravel-typefinder/README.md) — plugin options, debounce behaviour, alternative install from vendor

Development
-----------

[](#development)

```
# Install PHP dependencies
composer install

# Install JS dependencies
npm install

# Run PHP tests
vendor/bin/phpunit

# Check PHP code style
vendor/bin/pint --test

# Build the Vite plugin
npm -w packages/vite-plugin-laravel-typefinder run build

# Lint the Vite plugin
npm -w packages/vite-plugin-laravel-typefinder run lint
```

Contributing
------------

[](#contributing)

Bug reports, feature proposals, and PRs are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md) — it covers the commit-message convention (Conventional Commits), the pre-commit toolchain (`pint`, `rector`, `npm run lint`), and the CI matrix your changes need to pass.

Security
--------

[](#security)

If you've found a security issue, please follow the disclosure process in [SECURITY.md](SECURITY.md) rather than opening a public issue.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance95

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

16

Last Release

32d ago

Major Versions

1.3.0 → 2.0.02026-04-14

2.0.0 → 3.0.02026-04-14

3.0.1 → 4.0.02026-04-15

PHP version history (2 changes)v1.0.0PHP ^8.2

v1.1.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c81d33fb4c03952a1bf5b52d0ce4ce3ae47f970ede413387fd9c0aff84391ce?d=identicon)[pentacore](/maintainers/pentacore)

---

Top Contributors

[![pentacore](https://avatars.githubusercontent.com/u/2103945?v=4)](https://github.com/pentacore "pentacore (196 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (1 commits)")

---

Tags

phplaraveltypescriptmodelstypesenums

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/pentacore-laravel-typefinder/health.svg)

```
[![Health](https://phpackages.com/badges/pentacore-laravel-typefinder/health.svg)](https://phpackages.com/packages/pentacore-laravel-typefinder)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[flarum/core

Delightfully simple forum software.

261.4M2.2k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
