PHPackages                             vagebond/runtype - 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. vagebond/runtype

ActiveLibrary

vagebond/runtype
================

Transform Laravel Resources and models into Typescript interfaces

0.3.3(4mo ago)233.8k↑416.7%3[1 issues](https://github.com/vagebnd/runtype/issues)[1 PRs](https://github.com/vagebnd/runtype/pulls)MITPHPPHP ^8.2||^8.3||^8.4CI passing

Since Feb 13Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/vagebnd/runtype)[ Packagist](https://packagist.org/packages/vagebond/runtype)[ Docs](https://github.com/vagebnd/runtype)[ RSS](/packages/vagebond-runtype/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (13)Versions (12)Used By (0)

Laravel Typescript Generator: Runtype
=====================================

[](#laravel-typescript-generator-runtype)

[![Latest Version on Packagist](https://camo.githubusercontent.com/504bdb995d28baa1fb40b0d34409605b317b56e98a35ce70dd9e4251c7ea6637/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616765626f6e642f72756e747970652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vagebond/runtype)[![GitHub Tests Action Status](https://camo.githubusercontent.com/bb726a51b4e67d6ef3ad5c2a01a419063d69c8012a18c70ba897792a72bb4c1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76616765626e642f72756e747970652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473)](https://github.com/vagebnd/runtype/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/36ec1951bb618652edacf9733d9713cd0f48aaf218b5f8d6d218b514ea6d362d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76616765626e642f72756e747970652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e)](https://github.com/vagebnd/runtype/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/a4219a2dbe2b70661bad8407822ebcbc424f03e741dba89845c09b4e4b318437/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76616765626f6e642f72756e747970652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vagebond/runtype)

Generate TypeScript interfaces from Laravel Models &amp; Resources

This resource:

```
use Illuminate\Http\Resources\Json\JsonResource;

/** @mixin \App\Models\Product */
class ProductResource extends JsonResource
{
    public $showHiddenData = false;

    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'hidden' => $this->when($this->showHiddenData, false),
        ];
    }
}
```

will be converted into this interface:

```
export interface ProductResourceType {
    id: number;
    name: string;
    hidden?: boolean;
}
```

You can read the full documentation [here](https://runtype.vagebond.nl/).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require vagebond/runtype --dev
```

You can publish the config file with:

```
php artisan vendor:publish --tag="runtype-config"
```

Usage
-----

[](#usage)

```
php artisan runtype:generate
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Gianluca Riggio](https://github.com/mxaGianluca)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance77

Regular maintenance activity

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.1% 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 ~106 days

Recently: every ~163 days

Total

11

Last Release

123d ago

PHP version history (3 changes)0.0.1PHP ^8.1

0.2.0PHP ^8.1||^8.2

0.3.0PHP ^8.2||^8.3||^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/022e09c22f098cde82ba4e5c8fd861cdd978ae019b1228ac7de60ead6bcaec4c?d=identicon)[vagebond](/maintainers/vagebond)

---

Top Contributors

[![mxaGianluca](https://avatars.githubusercontent.com/u/1021708?v=4)](https://github.com/mxaGianluca "mxaGianluca (96 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![rick-bongers](https://avatars.githubusercontent.com/u/67374906?v=4)](https://github.com/rick-bongers "rick-bongers (3 commits)")

---

Tags

generatorlaravelphp8typescriptlaravelgeneratortypescriptvagebondruntype

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/vagebond-runtype/health.svg)

```
[![Health](https://phpackages.com/badges/vagebond-runtype/health.svg)](https://phpackages.com/packages/vagebond-runtype)
```

###  Alternatives

[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k7.8M57](/packages/dedoc-scramble)[worksome/envy

Automatically keep your .env files in sync.

6871.8M](/packages/worksome-envy)[elegantly/laravel-translator

All on one translations management for Laravel

6216.9k](/packages/elegantly-laravel-translator)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

188.5k](/packages/tarfin-labs-event-machine)

PHPackages © 2026

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