Download the PHP package arbory/nova-grouped-boolean-field-group without Composer
On this page you can find all versions of the php package arbory/nova-grouped-boolean-field-group. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nova-grouped-boolean-field-group
Grouped boolean group field
Field which extends default Laravel Nova BooleanGroup field to be able to pass grouped collections.
To resolve and hydrate the field values, custom callbacks can be passed either to field constructor as arguments or via and field callbacks.
For field values, either pass a grouped collection or a custom callback to field callback.
Installation
Basic Usage:
Field instantiation with all arguments passed via constructor:
or via field callbacks:
Mapping field options
By default, field option key and value pairs will contain value of specified . For custom option labels, use field method.
Customising field layout
The field has 3 custom layouts available - row layout, full width column layout and full width layout.
Row layout can be enabled via method.
Full width column layout can be enabled via method.
Full width layout can be enabled via method.
Field group and global toggles
Field groups and entire field content can be made collapsible.
Field group toggles can be enabled via method. Global field toggle can be enabled via method.
When using toggles, it is also possible to specify toggle state, whether the field or groups should be open on page load.
To keep groups open in form view, use method. To keep groups open in details view, use method. To keep groups open in both views, use method.
To keep field open in form view, use method. To keep field open in details view, use method. To keep field open in both views, use method.
Group and global select all
This feature enables a checkbox, which will make it possible to toggle an entire group or all checkboxes within this field.
To enable group select all checkbox, use . To enable global select all checkbox, use .
Filters
It is also possible to add filters via method.
The method accepts a single parameter with filter options of type array. This filter toggles field groups by group names that come from field field options collection. Filter options should be keyed as .
A brief example of preparing a filter options collection:
Custom translations for global toggle and filter field
It is possible to set custom field labels for global toggle and filter field.
To do so, use or method and pass a string of your choice.