Download the PHP package emhashef/typoway without Composer
On this page you can find all versions of the php package emhashef/typoway. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download emhashef/typoway
More information about emhashef/typoway
Files in emhashef/typoway
Package typoway
Short Description Laravel package for generating typescript based routes
License
Informations about the package 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
- π 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
TypoWay utilizes the dedoc/scramble package to analyze Laravel routes and extract type definitions.
Installation
Install the package via Composer:
Usage
Run the command to generate TypeScript route files:
Options
--apisβ Generate API routes only--inertiaβ Generate Inertia.js routes only
Example:
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:
Configuration
To publish the configuration file, run the following command:
You can configure excluded route names in the config/typoway.php file. These routes will not be included in the generated TypeScript definitions.
Modify this array to exclude additional route names as needed. Wildcards (*) can be used to match multiple routes.
License
This package is open-source and released under the MIT License.
All versions of typoway with dependencies
spatie/invade Version ^2.1
dedoc/scramble Version ^0.12
illuminate/support Version ^10.0|^11.0|^12.0