Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Form Components Laravel Package

protonemedia/laravel-form-components

Deprecated package providing Blade form components for Laravel (inputs, selects, checkboxes, radios) with validation, model binding, defaults, translations, and customizable vendor styling for Tailwind CSS v1/v2 and Bootstrap 4/5.

View on GitHub
Deep Wiki
Context7

Getting Started

Start by installing the package via Composer and publishing its config:

composer require protonemedia/laravel-form-components  
php artisan vendor:publish --provider="PavelBal\Symfony\Component\Form\FormBundle\FormBundle" --tag="form-components-config"

⚠️ Critical note: This package is deprecated (archived as of 2023-02-21) and no longer maintained. It does not support Laravel 10+, Livewire 3, or Tailwind CSS 3+. Consider using alternatives like Laravel Form Components (community-maintained fork), Jetstream + Livewire, or modern alternatives like Filament Forms.
If proceeding with legacy use:

  • Configure config/form-components.php (e.g., 'framework' => 'tailwind-forms')
  • Use @bind($model) blocks for model-driven forms
  • Begin with a simple form:
<x-form action="{{ route('users.store') }}">
    @bind($user)
        <x-form-input name="name" />
        <x-form-email name="email" />
        <x-form-submit />
    @endbind
</x-form>

Implementation Patterns

  • Model Binding & Reusability: Use @bind() to bind models to entire form sections—ideal for CRUD views (create/edit). Override bindings per-field with :bind="$otherModel" or :bind="false".
  • Livewire Integration: Wrap form elements with @wire for wire:model-like behavior:
<x-form wire:submit.prevent="submit">
    @wire('debounce.300ms')
        <x-form-input name="email" />
    @endwire
    <x-form-submit>Send</x-form-submit>
</x-form>
  • Multi-language Support: With spatie/laravel-translatable, use the language attribute for translatable fields:
<x-form-textarea name="title" language="en" placeholder="English title" />
<x-form-textarea name="title" language="nl" placeholder="Dutch title" />
  • Grouping & Layout: Use <x-form-group> for inline radios/checkboxes or wrapping related fields. Wrap complex sections in custom Blade components (e.g., <x-user-details-section>) that leverage these primitives.
  • Validation Errors: Errors show automatically—no extra code needed. Suppress with :show-errors="false" if using custom error UI.

Gotchas and Tips

  • Deprecation Warning: This package is archived and unmaintained. Critical security updates won’t happen. Verify compatibility with your stack (e.g., Livewire 2 only, Tailwind v2.x only).
  • Tailwind CSS Customization: Published views are not included by default. Run php artisan vendor:publish --tag="form-components-views" to override templates—but be warned: future updates won’t sync.
  • Date Casting: Enable use_eloquent_date_casting in config to handle date/datetime casts properly. Without it, Carbon instances break the form.
  • Many-to-Many Selects: Use many-relation attribute for BelongsToMany relationships (e.g., <x-form-select name="tags[]" :options="$post->tags->pluck('name', 'id')" many-relation />).
  • Old Input Repopulation: Forms auto-repopulate on validation failure—just ensure your controller uses ->withInput() on redirects.
  • Migration Gotcha: If upgrading from v2→v3, republish views if you customized them, as directive signatures (@wire) changed.
  • Extensibility: Override component logic by extending Protonemedia\LaravelFormComponents\Components classes in your service provider, then binding custom implementations.
  • Testing Tip: Mock old() input in tests using Request::replace() to simulate form submissions.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport