You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-5Lines changed: 29 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,10 +230,34 @@ class Employee extends Model implements MappableRelationships
230
230
231
231
You can pass on following items for your related model's attributes:-
232
232
1.`component`: The component use to render the field. You should provide the component name specified in the field like Text::class, Number::class, Boolean::class and so on.
233
-
3.`label`: Label for your field. This will also be used as the field name in error messages.
234
-
4.`rules`: A rule string in [Laravel Validation format](https://laravel.com/docs/5.8/validation#available-validation-rules).
235
-
5.`messages`: An array of error messages to be used in validation.
236
-
6.`placeholder`: A placeholder for your field.
233
+
2.`label`: Label for your field. This will also be used as the field name in error messages.
234
+
3.`rules`: A rule string in [Laravel Validation format](https://laravel.com/docs/5.8/validation#available-validation-rules).
235
+
4.`messages`: An array of error messages to be used in validation.
236
+
5.`placeholder`: A placeholder for your field.
237
+
6.`options`: Additional options for your components
238
+
239
+
### Select Component
240
+
To pass dropdown options to your select component, pass an array of key values to options
241
+
```php
242
+
'component => Select::class,
243
+
'options' => [
244
+
'options' => [
245
+
['label' => 'Yes', 'value' => true],
246
+
['label' => 'No', 'value' => false],
247
+
],
248
+
]
249
+
```
250
+
251
+
### Number/Currency Component
252
+
You can pass `min`, `max` and `step` to number and currency field
253
+
```php
254
+
'component' => Currency::class,
255
+
'options' => [
256
+
'min' => 0,
257
+
'max' => 100,
258
+
'step' => 10,
259
+
],
260
+
```
237
261
238
262
## Supported fields
239
263
@@ -258,7 +282,7 @@ You can use any field you can add to your Nova resource with `Field::make` synta
258
282
- Image Field
259
283
- File Field
260
284
261
-
**_NOTE:_** You can pass any additional arguments (like options for your select field) with your settings map.
285
+
**_NOTE:_** You can pass any additional arguments (like options for your select field) with your settings map using `options`.
0 commit comments