Download the PHP package rylacdang/formcast without Composer
On this page you can find all versions of the php package rylacdang/formcast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rylacdang/formcast
More information about rylacdang/formcast
Files in rylacdang/formcast
Package formcast
Short Description Cast your Laravel FormRequest rules to typed Zod schemas, TypeScript types, and Laravel-identical error messages.
License MIT
Homepage https://github.com/rylacdang/formcast
Informations about the package formcast
Cast your Laravel FormRequest rules to the client.
Formcast reads your Laravel FormRequest classes and generates typed Zod schemas, TypeScript types, and Laravel-identical error messages for your Inertia (Vue / React) and standalone (Expo / Axios) apps. Client-safe rules validate instantly in the browser (0 ms), while server-only rules (unique, exists, closures) are routed through Inertia's built-in Precognition only after client checks pass.
[!CAUTION] Client-side validation is for user experience only. Laravel validation on the server is never optional.
Installation
Add the Vite plugin to vite.config.ts:
60-Second Example
1. Write your normal Laravel FormRequest
2. Generate typed casts (or let the Vite plugin do it automatically)
3. Use in Vue or React with Inertia + Wayfinder
Why Formcast?
| Feature | Other Zod generators | Precognition only | Formcast |
|---|---|---|---|
FormRequest → Zod + TS types |
✅ | ❌ | ✅ |
Laravel-identical messages (messages(), attributes(), lang/) |
❌ / partial | ✅ | ✅ |
| Hybrid validation (Zod first, Precognition only for server rules) | ❌ | ❌ (every check hits server) | ✅ |
First-class Inertia useFormcast() (Vue & React) |
❌ | ✅ | ✅ |
| Vite plugin with debounced auto-regeneration | ❌ | N/A | ✅ |
Controller/route mapping (usedBy, Wayfinder-ready) |
❌ | N/A | ✅ |
Laravel semantics (TrimStrings, "" = missing, "5" int) |
partial | ✅ | ✅ |
| Automated Laravel-vs-Zod parity suite | ❌ | N/A | ✅ |
| Framework-agnostic core (Expo / React Native / Axios) | ❌ | ❌ | ✅ |
| Ships Laravel Boost guidelines & AI skill | ❌ | ❌ | ✅ |
Documentation
- Installation & Configuration
- Generating Casts & CI Checks
- Vue + Inertia Guide
- React + Inertia Guide
- Standalone Usage (Expo / React Native / Axios)
- Hybrid Validation & Precognition
- Messages & Locales
- Laravel Wayfinder Integration
- Rule Support Matrix
- Custom Client-Side Rules
- AI Skill & Laravel Boost
- Troubleshooting
License
Formcast is open-sourced software licensed under the MIT license.
All versions of formcast with dependencies
illuminate/console Version ^12.0 || ^13.0
illuminate/routing Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
illuminate/validation Version ^12.0 || ^13.0
spatie/laravel-package-tools Version ^1.93
symfony/finder Version ^7.0 || ^8.0