mlbrgn / laravel-form-components
Blade components to rapidly build forms with Bootstrap 5.
Installs: 3 634
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
Language:Blade
pkg:composer/mlbrgn/laravel-form-components
Requires
- php: ^8.1 || ^8.2 || ^8.3
- barryvdh/laravel-ide-helper: ^3.0.0
- illuminate/support: ^9.0 || ^10.0 || ^11.0 || ^12.0
- symfony/http-foundation: ^6.0 || ^7.0
Requires (Dev)
- larastan/larastan: ^3.0.0
- laravel/pint: ^1.16
- mockery/mockery: ^1.4.4
- nesbot/carbon: ^3.0.0
- orchestra/testbench: ^10.0.0
- orchestra/testbench-browser-kit: ^10.0.0
- pestphp/pest: ^4.0.0
- pestphp/pest-plugin-drift: ^4.0.0
- pestphp/pest-plugin-type-coverage: ^4.0.0
- spatie/laravel-translatable: ^6.0.0
- symfony/dom-crawler: ^7.0.0
- dev-main
- 1.0.112
- 1.0.111
- 1.0.110
- 1.0.109
- 1.0.108
- 1.0.107
- 1.0.106
- 1.0.105
- 1.0.104
- 1.0.103
- 1.0.102
- 1.0.101
- 1.0.100
- 1.0.99
- 1.0.98
- 1.0.97
- 1.0.96
- 1.0.95
- 1.0.94
- 1.0.93
- 1.0.92
- 1.0.91
- 1.0.90
- 1.0.89
- 1.0.88
- 1.0.87
- 1.0.86
- 1.0.85
- 1.0.84
- 1.0.83
- 1.0.82
- 1.0.81
- 1.0.80
- 1.0.79
- 1.0.78
- 1.0.77
- 1.0.76
- 1.0.75
- 1.0.74
- 1.0.73
- 1.0.72
- 1.0.71
- 1.0.70
- 1.0.69
- 1.0.68
- 1.0.67
- 1.0.66
- 1.0.65
- 1.0.64
- 1.0.63
- 1.0.62
- 1.0.61
- 1.0.60
- 1.0.59
- 1.0.58
- 1.0.57
- 1.0.56
- 1.0.55
- 1.0.54
- 1.0.53
- 1.0.52
- 1.0.51
- 1.0.50
- 1.0.49
- 1.0.48
- 1.0.47
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/npm_and_yarn/vite-7.3.1
- dev-dependabot/npm_and_yarn/sass-1.97.2
This package is auto-updated.
Last update: 2026-01-12 18:36:55 UTC
README
MLBRGN Laravel Form Components
Reusable Blade components to build accessible Bootstrap 5 forms with ease.
Key features
- Bootstrap 5 form markup out-of-the-box
- Blade components for
input,select,textarea,checkbox,radio,label,group,button,submit formwrapper with configurable client- or server-side validation modes- Optional TinyMCE-based
<x-form-html-editor>component - Consistent error rendering and feedback helpers
- Data binding helpers with
@bind/@endbind - Publishable, self-contained JS/CSS assets and auto-loader
- Configurable tag prefix (default:
form→<x-form-input />)
This package is a focused adaptation of the excellent work by Protonemedia, simplified to only support Bootstrap 5 views.
Links
- Getting Started: docs/getting-started.md
- Components Reference: docs/components.md
- Validation: docs/validation.md
- HTML Editor: docs/html-editor.md
- Assets: docs/assets.md
- Configuration: docs/configuration.md
- reCAPTCHA v2: docs/recaptcha-v2.md
- Binding (
@bind): docs/binding.md
Installation
- Require the package via Composer:
composer require mlbrgn/laravel-form-components
- Publish config and assets:
php artisan vendor:publish --tag=mlbrgn-form-components-config php artisan vendor:publish --tag=mlbrgn-form-components-assets
This publishes:
- Config:
config/form-components.php - Public assets:
public/vendor/mlbrgn/laravel-form-components/
- (Optional) Configure the tag prefix in
config/form-components.php:
'tag_prefix' => env('FORM_COMPONENTS_TAG_PREFIX', 'form'),
With the default prefix, you’ll use components like <x-form-input />, <x-form-select />, etc.
Quick start
In your Blade view:
<x-form-form action="{{ route('posts.store') }}" method="POST"> <x-form-group> <x-form-label for="title">Title</x-form-label> <x-form-input name="title" id="title" required /> <x-form-errors name="title" /> </x-form-group> <x-form-group> <x-form-label for="content">Content</x-form-label> <x-form-textarea name="content" id="content" rows="6" /> </x-form-group> <x-form-checkbox name="published" value="1">Publish immediately</x-form-checkbox> <x-form-submit>Save</x-form-submit> </x-form-form>
Validation assets are automatically injected when the form’s validationMode resolves to a client mode.
Validation modes
Set on <x-form-form> via the validationMode attribute, or globally via config('form-components.default-form-validation-mode').
Supported values:
server(default): uses pure server-side validation; disables native browser validationclient-default: enables browser validation and loads minimal client assetsclient-custom: disables native browser validation but loads the package’s client-side validation assets/classes
Example:
<x-form-form method="POST" validationMode="client-default"> ... </x-form-form>
See docs/validation.md for details.
HTML editor (TinyMCE)
Use <x-form-html-editor> to render a WYSIWYG editor powered by TinyMCE. The component loads the necessary assets via the internal asset loader.
<x-form-html-editor name="body" label="Body" :tinymce-config="['menubar' => false]" />
Global editor options can be set via form-components.html_editor_tinymce_global_config in the config file. See docs/html-editor.md.
Assets
The package includes an asset loader published to public/vendor/mlbrgn/laravel-form-components. By default, forms/components pull in what they need. You can also include assets manually:
<x-mlbrgn-form-components::assets :config="['features' => ['validation' => true, 'htmlEditor' => true]]" />
See docs/assets.md for more options.
Data binding with @bind
Bind a model/array to nested inputs without repeating value for each control:
@bind($post) <x-form-input name="title" /> <x-form-textarea name="content" /> @endbind
Use old() data and defaults seamlessly. See docs/binding.md for details.
reCAPTCHA v2
The <x-form-recaptcha-v2 /> component renders v2 widgets. Configure keys under form-components.recaptcha.*. See docs/recaptcha-v2.md.
Configuration
Open config/form-components.php to adjust:
framework(Bootstrap 5 supported)tag_prefix- Validation and wrapper-class behavior
- HTML editor global config and content CSS
- reCAPTCHA settings
See docs/configuration.md for the full list.
Upgrading from protonemedia/laravel-form-components
This package is a streamlined fork focused on Bootstrap 5. Some options and views were removed or renamed. See docs/upgrade.md for guidance.
Credits
- Based on: https://github.com/protonemedia/laravel-form-components
- Authors: Evertjan Garretsen, Nick D.
License
The MIT License (MIT). Please see License File for more information.
Treeware
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work.