erag / inertia-forms
Define Laravel forms in PHP and render them with Inertia.js in Vue, React, or Svelte. Validation, conditional visibility, authorization, and model binding included.
Package info
github.com/eramitgupta/laravel-Inertia-forms
Language:TypeScript
pkg:composer/erag/inertia-forms
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/auth: ^13.0
- illuminate/console: ^13.0
- illuminate/contracts: ^13.0
- illuminate/database: ^13.0
- illuminate/http: ^13.0
- illuminate/routing: ^13.0
- illuminate/support: ^13.0
- illuminate/validation: ^13.0
- inertiajs/inertia-laravel: ^3.0
Requires (Dev)
- laravel/pint: ^1.20
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.0
- pestphp/pest-plugin-laravel: ^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel Inertia Forms
Define Laravel forms in PHP. Render them in Vue, React, or Svelte with one <Form> component.
Write the fields, layout, and validation once in a Laravel class. The same class draws the form in the browser and validates the request on the server, so you never repeat labels, rules, or error handling again.
Documentation ยท Live Demo ยท Sponsor
Features
- ๐งฉ Forms in PHP โ one class holds the fields, layout, validation, and submit route.
- ๐ 22 fields โ text, textarea, hidden, combobox (searchable, multiple, server search), radio, checkbox, checkbox group, toggle, date and date range, time, color, slider, file upload, tags, key-value, repeater, blocks, link, slug, one-time code, chat composer, and submit buttons, plus headings, text, callouts and separators.
- โก Vue, React and Svelte โ the same PHP class renders in all three, built on one shared core with no runtime dependencies.
- โ
Validation from the fields โ
required(),email(), options, file types, and more become Laravel rules. Validate with#[Validate]. - ๐๏ธ Conditional fields โ
visibleWhen()andhiddenWhen()work in the browser and in validation. - ๐ Authorization โ
authorizedWhen()removes fields, and their rules, for users who should not see them. - ๐ Model binding โ
->bind($user)fills an edit form from a model or array. - ๐ช Wizards โ multi-step forms with a stepper, each step checked on the server.
- ๐ Fieldsets and grid layout โ group fields, add legends and icons, and use columns.
- ๐ฏ Several actions โ submit buttons with variants, sizes, icons and
intent(), plusdisableUntilDirty()for unsaved changes. - ๐จ 200+ icons, no icon library โ
icon('rocket'), sent as SVG only when used. Register your own withIcon::register(). - ๐งฑ Custom fields โ add your own PHP field and its Vue, React or Svelte component.
- ๐ Accessible and themeable โ labels,
aria-*, focus handling, dark mode, accent colors, Tailwind CSS 4. - ๐ค Artisan and AI ready โ
erag:install-inertia-forms,make:form, and Laravel Boost guidelines with a skill for AI agents.
Documentation
https://erag.in/laravel-inertia-forms/
Support
- ๐ Bugs and ideas โ open a GitHub issue.
- โญ Like it? โ star the repository so more Laravel developers find it.
Sponsorship
Laravel Inertia Forms is free and open source. If it saves you time, please consider sponsoring its development:
๐ Sponsor Amit Gupta on GitHub
Sponsors keep the package maintained, documented, and growing.