Download the PHP package metalogico/laravel-formello without Composer
On this page you can find all versions of the php package metalogico/laravel-formello. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download metalogico/laravel-formello
More information about metalogico/laravel-formello
Files in metalogico/laravel-formello
Package laravel-formello
Short Description A Laravel package for generating Bootstrap 5 and Tailwind CSS 4 forms based on models
License MIT
Homepage https://github.com/metalogico/laravel-formello
Informations about the package laravel-formello
Formello
A Laravel package for generating Bootstrap 5 and Tailwind CSS 4 forms based on models. Laravel 11+
Formello is a comprehensive form generation and handling tool for Laravel applications, inspired by Django forms.
🎉 Motivation
The Laravel ecosystem offers powerful tools for building applications, from full-featured admin panels like Nova and Filament to complex form-handling libraries. However, I felt there was a need for a tool that sits in the "sweet spot" between these solutions.
Formello was created for developers who need to generate forms quickly without the overhead of a complete admin panel, but who also want a simpler, more intuitive API than more complex form libraries. It's designed to automate the repetitive aspects of form creation while giving you full control over the final output.
Currently, Formello ships with built-in support for Bootstrap 5 and Tailwind CSS 4.
If you use this project, please consider giving it a ⭐.
✨ Features
- Fluent field builder with
FormelloField::make()API - Reactive system for field interdependencies (client-side JS and/or server-side PHP callbacks)
- Automatic form rendering with Bootstrap 5 and Tailwind CSS 4
- Rich set of built-in widgets:
- Text, Textarea, Hidden
- Select (with multiple), TomSelect (AJAX, search, dependent selects)
- Radio, Checkboxes, Toggle
- Range
- Date, DateTime (Flatpickr with Italian localization)
- Mask (IMask.js input masking)
- Color, ColorSwatch (Pickr nano)
- Wysiwyg (Jodit Editor)
- Upload
- Separator
- Customizable and extensible widgets
- Modular asset management (disable libraries your theme already includes)
- Automatic error handling and display
- Artisan scaffolding command
⚠️ Upgrading to v2.x
Versions 2.0 and 2.1 introduce breaking changes from the 1.x series.
Breaking changes in v2.0
- Fluent field builder:
fields()now returnsFormelloField[]instead of associative arrays - Select2 removed: use
TomSelectWidgetinstead.HasSelect2Widgettrait replaced byHasTomSelectWidget - jQuery removed: no longer a dependency
- Widget rename:
'boolean'is now'toggle' - Tailwind CSS 4: full widget support added
New in v2.1
- Reactive System: callback-based field interdependencies with
reactive.client(JS) andreactive.server(PHP)
Migration from v1.x
After upgrading, republish the assets:
🛠️ Installation
-
Install the package via Composer:
-
Publish the assets:
- (Optional) Auto-publish assets on update
To ensure that Formello's assets are automatically updated every time you run composer update, you can add a command to the post-update-cmd script in your project's composer.json file.
😎 How to use
Creating a Form
Create a new form class that extends Metalogico\Formello\Formello. Fields are defined using the fluent FormelloField builder.
Remember to add these fields to your model's $fillable array otherwise Formello will not render them.
Using the artisan command
You can generate a basic formello file using this command:
The script will generate a skeleton file that contains a basic field definition for each fillable field found in your model.
Rendering the Form
In your controller for an empty form (create action):
or, for an edit form:
Then in your blade template:
If you want to render only the fields (without the <form> tag) you can use:
Conditional Logic
You can use isCreating() and isEditing() methods in your form class to dynamically change fields based on the form's mode:
CSS Framework Override
By default, Formello uses the framework set in config/formello.php. You can override it per form:
⚡ Reactive System
The reactive system enables field interdependencies without writing custom JavaScript from scratch. Add ->reactive() to any field to declare callbacks.
Client-side (instant)
Server-side (async PHP)
For operations that need database access (e.g., dependent selects):
Note: Server-side reactive requires a
<meta name="csrf-token" content="{{ csrf_token() }}">tag in your layout.
For full documentation see docs/reactive.md.
Creating Custom Widgets
Formello is designed to be extensible. To create a custom widget:
1. Publish the config file
Add your widget alias to the custom_widgets array:
2. Create the Widget Class
Create a class extending Metalogico\Formello\Widgets\BaseWidget:
3. Create the Blade Template
Create resources/views/widgets/star-rating.blade.php:
4. Use it in your form
Custom widgets get the reactive system for free — just add ->reactive() to the field config.
🎨 Asset Management
Formello uses a modular system for loading JS and CSS assets, avoiding conflicts with themes that already include the same libraries.
Blade Directives
Add these directives to your layout:
Disabling Libraries
If your theme already includes a library, disable it in config/formello.php:
Supported Libraries
| Widget | Library | Assets |
|---|---|---|
| TomSelect | Tom Select | tom-select.complete.js, tom-select.default.min.css |
| Date, DateTime | Flatpickr | flatpickr.min.js, l10n/it.js, flatpickr.min.css |
| Mask | IMask | imask.min.js |
| Color, ColorSwatch | Pickr | pickr.min.js, nano.min.css |
| Wysiwyg | Jodit | jodit.min.js, jodit.min.css |
📚 Documentation
- Widget configuration reference
- Reactive system
⚖️ License
Laravel Formello is open-sourced software licensed under the MIT license.
🍺 Donations
If you really like this project and you want to help me please consider buying me a beer 🍺.