Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.

Commit f74ea0a

Browse files
committed
Update README.md
1 parent a4cca9e commit f74ea0a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ composer require protonemedia/laravel-form-components
3131

3232
## Configuration
3333

34-
todo
34+
There is no configuration needed unless you want to [customize the Blade views and components](#customize-the-blade-views).
3535

3636
## Quick example
3737

@@ -140,6 +140,20 @@ You can even mix targets!
140140
</x-form>
141141
```
142142

143+
### Override or remove a binding
144+
145+
You can override the `@bind` directive by passing a target directly to the element using the `:bind` attribute. If you want to remove a binding for a specific element, pass in `false`.
146+
147+
```blade
148+
<x-form>
149+
@bind($video)
150+
<x-form-input name="title" label="Title" />
151+
<x-form-input :bind="$videoDetails" name="subtitle" label="Subtitle" />
152+
<x-form-textarea :bind="false" name="description" label="Description" />
153+
@endbind
154+
</x-form>
155+
```
156+
143157
### Select elements
144158

145159
Besides the `name` attribute, the `select` element has a required `options` attribute, which should be a simple *key-value* array.
@@ -191,13 +205,13 @@ You can group checkbox and radio elements on the same horizontal row by adding a
191205
</x-form-group>
192206
```
193207

194-
### Old data
208+
### Old input data
195209

196-
*todo*
210+
When a validation errors occurs, and Laravel redirects you back, the form will be re-populated with the old input data. This old data will override any binding or default value.
197211

198212
### Handling translations
199213

200-
*todo*
214+
201215

202216
### Customize the blade views
203217

0 commit comments

Comments
 (0)