nurmuhammet/dynamic-fields is a Laravel package for dynamic fields for laravel nova..
It currently has 2 GitHub stars and 4.168 downloads on Packagist (latest version 1.1.0).
Install it with composer require nurmuhammet/dynamic-fields.
Discover more Laravel packages by nurmuhammet
or browse all Laravel packages to compare alternatives.
Last updated
php: >=8.0laravel/nova: ^4.0Install the package in a Laravel Nova project via Composer:
# Install nova-inputmask
composer require nurmuhammet/dynamic-fields
use Nurmuhammet\DynamicFields\DynamicFields;
// ...
DynamicFields::make('Attributes', 'attributes')
->fields([
['type' => 'text', 'name' => 'Brand', 'label' => 'Label', 'required' => true, 'placeholder' => 'Adidas...', 'default' => 'default value'],
['type' => 'number', 'name' => 'B'],
['type' => 'select', 'name' => 'Colour', 'label' => 'Colour of product', 'options' => [
['label' => 'A', 'value' => 10],
['label' => 'B', 'value' => 19]
]]
])
->fillWithArrayName('names') // if you want form name should be array, like: `names[]`
fields(array|callable $fields)| Attribute | type | required | default |
| :---: | :---: | :---: | :---: |
| name | string | yes | |
| type | string, valid input types: text, number, select | yes | |
| label | string, integer... | no | name will be capitalized |
| default | string, integer... | no | null |
| options | array, returned array must have label & value keys, example: [['label' => 'Field label', 'value' => 'field value'], ...] | no | null |
| required | bool | no | false |
| placeholder | string, integer... | no | '' |
fillWithArrayName(string $requestArrayName = '')If you find my open-source library helpful, consider supporting it by buying me a coffee: Buy Me a Coffee. ☕