timolake/livewire-forms
livewire-forms
one form for creating & updating data, based on laravel livewire
Installation
You can install the package via composer:
composer require timolake/livewire-forms
How to use
- create class in \App\Http\Livewire\Forms and extend form timolake\LivewireForm or timolake\LivewireItemForm
- implement abstact classes
populate rules() with all attributes wich need to be edited
use model.attribute notation - create view
validation
for model validation always use model.attribute
public function rules(): array
{
return [
'model.name' => 'required|min:2|max:255',
];
}
for item validation, use model.items and selectedItem.attribute
public function rules(): array
{
return [
'items' => 'required|min:1',
];
}
public function itemRules(): array
{
return [
'selectedItem.foreign_key' => 'required|numeric',
'selectedItem.name' => 'required|min:2|max:255',
];
}
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
641,106,524
9,700
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
418,291,778
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
394,964,158
4,660
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 3.1.0 | ^8.1 | ~10| | MIT | |
| 3.0.0 | ^8.1 | ~10| | MIT | |
| 2.2.0 | ^8.1 | ~10| | MIT | |
| 2.1.2 | ^8.1 | ~10| | MIT | |
| 2.1.1 | ^8.1 | ~10| | MIT | |
| 2.1.0 | ^8.1 | ~10| | MIT | |
| 2.0.0 | ^8.1 | ~10| | MIT | |
| 1.11.0 | ^8.1 | ^9.0| | MIT | |
| 1.10.0 | ^8.1 | ^9.0| | MIT | |
| 1.9.3.1 | ^8.1 | ^9.0| | MIT | |
| 1.9.3 | ^8.1 | ^9.0| | MIT | |
| 1.9.2 | ^8.1 | ^9.0| | MIT | |
| 1.9.1.1 | ^8.1 | ^9.0| | MIT | |
| 1.9.1 | ^8.1 | ^9.0| | MIT | |
| 1.8.0 | ^8.1 | ^9.0| | MIT | |
| 1.7.0 | ^8.1 | ^9.0| | MIT | |
| 1.6 | ^8.1 | ^9.0| | MIT | |
| 1.5 | ^8.1 | ^9.0| | MIT | |
| 1.4 | ^8.1 | ^9.0| | MIT | |
| 1.3.1 | ^8.1 | ^9.0| | MIT | |
| 1.3 | ^8.1 | ^9.0| | MIT | |
| 1.2.2 | ^8.1 | ^9.0| | MIT | |
| 1.2.1 | ^8.1 | ^9.0| | MIT | |
| 1.2 | ^8.1 | ^9.0| | MIT | |
| 1.1 | ^8.1 | ^9.0| | MIT | |
| 1.0.4 | ^8.1 | ^9.0 | MIT | |
| 1.0.3 | ^8.1 | ^9.0 | MIT | |
| 1.0.2 | ^8.1 | ^9.0 | MIT | |
| 1.0.1 | ^8.1 | ^9.0 | MIT |