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

Commit 091f45b

Browse files
committed
Update README.md
1 parent f74ea0a commit 091f45b

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,17 @@ When a validation errors occurs, and Laravel redirects you back, the form will b
211211

212212
### Handling translations
213213

214+
This package supports `spatie/laravel-translatable` out of the box. You can add a `language` attribute to your element.
214215

216+
```blade
217+
<x-form-input name="title" language="en" :bind="$book" />
218+
```
219+
220+
This will result in the following HTML:
221+
222+
```html
223+
<input name="title[en]" value="Laravel: Up & Running" />
224+
```
215225

216226
### Customize the blade views
217227

@@ -223,7 +233,22 @@ When a validation errors occurs, and Laravel redirects you back, the form will b
223233

224234
### Prefix the components
225235

226-
*todo*
236+
You can define a prefix in the `form-components.php` configuration file.
237+
238+
```php
239+
240+
return [
241+
'prefix' => 'tailwind',
242+
];
243+
```
244+
245+
Now all components can be referenced like so:
246+
247+
```blade
248+
<x-tailwind-form>
249+
<x-tailwind-form-input name="company_name" />
250+
</x-tailwind-form>
251+
```
227252

228253
### Testing
229254

0 commit comments

Comments
 (0)