الصفحات · Laravilt
Forms
Build forms in PHP with 29 field types, rendered by Vue or React.
The laravilt/forms package lets you describe forms in PHP with a fluent API. Laravilt serializes the schema through Inertia v3 and renders it with Vue 3 (shadcn-vue / reka-ui) or React 19 (shadcn/ui), styled with Tailwind CSS v4.
React support requires Laravilt v1.1 or later.
Basic usage
In a resource, the form is defined in the static form() method:
php
To generate a standalone form class, run php artisan make:form UserForm (add --resource for a CRUD-style form).
Sections
- Inputs: text, textarea, number, PIN and hidden fields
- Selection: select, radio, checkbox, toggle
- Date & Time: date, date-time, time and date-range pickers
- Pickers: color, icon, tags, slider, rating
- Media: file upload, rich text, markdown and code editors
- Data: repeater, builder, key-value
- Layouts: sections, grids, tabs and wizards inside forms
- Reactive Fields: live updates and dependent fields
- Validation: rules and messages
- Custom Fields: build your own field types