PHPackages                             emhashef/typoway - 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. emhashef/typoway

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

emhashef/typoway
================

Laravel package for generating typescript based routes

v1.0.0-beta6(1y ago)1620PHPPHP ^8.1

Since Feb 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/emhashef/typoway)[ Packagist](https://packagist.org/packages/emhashef/typoway)[ RSS](/packages/emhashef-typoway/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (7)Used By (0)

TypoWay
=======

[](#typoway)

**TypoWay** is a Laravel package that generates TypeScript route definitions, including API endpoints, URLs, and Inertia.js form helpers. It provides a strongly typed way to work with routes in TypeScript-based front-end applications.

> **⚠️Warning**This package is currently in beta and may have breaking changes. Use with caution in production environments.

Features
--------

[](#features)

- 🚀 **Generate API route definitions** with TypeScript types
- 🔗 **Generate URL helpers** for clean and structured navigation
- ⚡ **Inertia.js form helpers** for better integration with Laravel-Inertia apps
- 🔥 **Automatic TypeScript typing** for request parameters

Note
----

[](#note)

TypoWay utilizes the `dedoc/scramble` package to analyze Laravel routes and extract type definitions.

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

[](#installation)

Install the package via Composer:

```
composer require emhashef/typoway --dev
```

Usage
-----

[](#usage)

Run the command to generate TypeScript route files:

```
php artisan typoway:generate
```

### Options

[](#options)

- `--apis` → Generate API routes only
- `--inertia` → Generate Inertia.js routes only

Example:

```
php artisan typoway:generate --apis
```

Output
------

[](#output)

Running the command generates the following TypeScript files:

- `routes.ts` – Contains all routes, APIs, and Inertia form helpers.
- `routes.urls.setup.ts` – Handles URL generation.
- `routes.apis.setup.ts` – Handles API request methods.
- `routes.inertia.setup.ts` – Handles Inertia form handling.

Example Output:

```
export const urls = {
  test: {
    index: () => `/api/test`,
    storeArray: () => `/api/store-array`,
  },
};

export const apis = {
  test: {
    index: (data?: { name?: string }): ApiResponse =>
      request("get", urls.test.index(), data),
    storeArray: (data?: { bob?: number[] }): ApiResponse =>
      request("post", urls.test.storeArray(), data),
  },
};
```

Configuration
-------------

[](#configuration)

To publish the configuration file, run the following command:

```
php artisan vendor:publish --tag=typoway
```

You can configure excluded route names in the config/typoway.php file. These routes will not be included in the generated TypeScript definitions.

```
return [
    'except-routes' => [
        "filament*",
        "scramble*",
        "debugbar*",
        "dusk*",
        "ignition*",
        "livewire*",
    ]
];
```

Modify this array to exclude additional route names as needed. Wildcards (\*) can be used to match multiple routes.

License
-------

[](#license)

This package is open-source and released under the MIT License.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance46

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~19 days

Total

6

Last Release

412d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45512247?v=4)[Mohammad Hosein Fallah](/maintainers/emhashef)[@emhashef](https://github.com/emhashef)

---

Top Contributors

[![emhashef](https://avatars.githubusercontent.com/u/45512247?v=4)](https://github.com/emhashef "emhashef (17 commits)")

### Embed Badge

![Health badge](/badges/emhashef-typoway/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M375](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M136](/packages/illuminate-cookie)

PHPackages © 2026

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