From 34f175a88f9e03f00083de320b2c32a6d71d2d47 Mon Sep 17 00:00:00 2001 From: Giorgio Balduzzi Date: Mon, 22 Jul 2024 09:48:11 +0200 Subject: [PATCH] v0.2.0 --- CHANGELOG.md | 4 ++ README.md | 123 +++++++++++++++++++++++++++++--------------------- composer.json | 2 +- 3 files changed, 76 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f6f3be..f1e1fdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `bs-blade-forms` will be documented in this file +## 0.2.0 - 2024-07-22 + +- Added `Form` element with automatic binding + ## 0.1.0 - 2024-07-15 - Initial beta release diff --git a/README.md b/README.md index e464a76..7f465c3 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,9 @@ components and Boostrap utilities. - **Reduced boilerplate**: Minimize repetitive code and simplify the form-building process - **Advanced Select Components**: Utilize `SearchSelect` and `MultiSelect` for enhanced and complex selection input needs, providing a better user experience. -- **Automatic Old Input Handling**: Automatically - manage [old input](https://laravel.com/docs/validation#repopulating-forms) based on the field name, ensuring form +- **Automatic Old Input Handling**: Automatically manage [old input](https://laravel.com/docs/validation#repopulating-forms) based on the field name, ensuring form repopulation is seamless. +- - **Automatic Form model binding**: Automatically binds to a model and populate the form with the corrisponding field - **Livewire Support**: Fully integrate with Livewire by forwarding tags (e.g., `wire:model`) to the underlying input/select elements. @@ -82,66 +82,85 @@ In your blade templates, use the provided components: Go from: ```html - - - - - - -
- newsletter) === '1') /> - -
+
+ @csrf + @method('patch') + + + + + + + +
+ newsletter) === '1') /> + +
+
``` To: ```bladehtml + + + + + + + +``` - +## Components - +#### Form -newsletter) -/> +Renders a form, with optional modal binding. + + +```bladehtml + + +... + ``` -## Components +Automatically adds `@csrf` and `@method(...)` when required. + +When a `model` is provided, `x-bs::` components will automatically use the model corresponding field as default value. #### SearchSelect diff --git a/composer.json b/composer.json index cf2701e..84834f6 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "tiknil", "bs-blade-forms" ], - "version": "0.1.1", + "version": "0.2.0", "homepage": "https://github.com/tiknil/bs-blade-forms", "license": "MIT", "type": "library",