michalkortas/laravelforms
Blade form components for Laravel 7–8 that generate Bootstrap-styled inputs fast, with built-in validation error support. Includes text, select, textarea, checkbox, radio, file, date/time, color, and more, with easy model binding for values.
Pros:
form-control, form-group), minimizing styling overhead.model-key="departments.id"), reducing boilerplate for CRUD forms.has-error classes), improving developer experience.<x-form-text>, <x-form-select>) encourage modular, reusable form logic.Cons:
richSelect feature (v1.9.0+) introduces JavaScript/AJAX, which may conflict with SSR or headless setups.Stack Compatibility:
richSelect requires JS (jQuery or vanilla). May need polyfills for older browsers or SSR environments.richSelect) requires additional tools (e.g., Laravel Dusk).Migration Path:
<x-form-text>) without rewriting entire forms.Form:: helpers or Livewire/Alpine inputs.richSelect) are opt-in.High:
richSelect feature introduces AJAX/JS complexity. Risks include:
Medium:
model-key="user.department.name") may require debugging for edge cases (e.g., null values).richSelect inputs need manual implementation.Low:
<x-form-text>, <x-form-select> are stable and well-tested.richSelect API calls (e.g., pagination, debouncing)?richSelect) in CI/CD pipelines?Best For:
Poor Fit:
richSelect adds complexity if the app already uses heavy JS libraries (e.g., Select2, Chosen).Phase 1: Basic Components (Low Risk)
<input>, <select>) with package components:
- <input type="text" name="name" class="form-control">
+ <x-form-text name="name" label="Full Name" />
artisan vendor:publish to customize templates if needed.Phase 2: Model Binding (Medium Risk)
<x-form-text :model="$user" name="email" label="Email" />
model-key paths for nested relations (e.g., user.address.city).Phase 3: Rich Select (High Risk)
richSelect for searchable/multi-select inputs:
<x-form-rich-select
name="roles"
:options="$roles"
api-url="/api/roles"
search-fields="name,slug"
/>
Phase 4: Advanced Features (Optional)
rich-select.blade.php for Tailwind CSS.| Stack Layer | Compatibility | Mitigation |
|---|---|---|
| Laravel Core | ✅ Full (7/8) | Use laravel/framework version constraints. |
| Bootstrap | ✅ Default (4/5) | Override CSS or use class attributes. |
| Eloquent | ✅ Full | Test nested relations (model-key). |
| Validation | ✅ Built-in | Extend with custom rules if needed. |
| JavaScript | ⚠️ Required for richSelect |
Polyfill for older browsers or SSR workarounds. |
| Testing | ✅ PHPUnit/Pest | Add Dusk tests for JS features. |
| CI/CD | ✅ No blockers | Monitor for JS errors in pipelines. |
richSelect for forms with repetitive data (e.g., tags, roles) where UX gains are highest.richSelect in production until tested.richSelect with large datasets (e.g., 500+ options) before production rollout.How can I help you explore Laravel packages today?