Skip to content

Commit cf16e7b

Browse files
committed
Update README.md
1 parent a9869fe commit cf16e7b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ The partial will contain the same templates as the previous examples, but this t
143143
@enderror
144144
```
145145

146+
Alternatively, you can also use the field name as the array key, by not specifying a key in advance:
147+
148+
```blade
149+
@include('forms.address', ['prefixer' => FormFieldPrefixer::make('client')->asArray()])
150+
```
151+
152+
Now the `address` field will look like this:
153+
154+
```blade
155+
<input name="client[address]" id="client_address" value="">
156+
157+
@error('client.address')
158+
{{ $message }}
159+
@enderror
160+
```
161+
146162
Again, if you did not specify a prefix, `client_` would be stripped off.
147163

148164
### Multi Dimensional Array Forms

0 commit comments

Comments
 (0)