marshmallow / boolean-group
A Laravel Nova field.
Installs: 681
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: ^8.0
- laravel/nova: ^4.0
README
Nova Boolean Group
This package extends the default Boolean Group field from Nova 4. This package adds the ablity to use HTML in the labels. This is handy when you have a lot of information to show in your boolean group labels.
In the example below you can see the difference in behaviour between the default Boolean Group from Nova and the Boolean Group from this package.
Installation
You can install the package via composer:
composer require marshmallow/boolean-group
Usage
The usage of this package could not be easier. You use it as you would use the BooleanGroup from Nova. Please check there documentation for all the cool stuff you can do with this field out of the box. The only addition is, you can now add HTML in your labels. This package will do the rest. Check out the example below. This is the code we’ve use to take the screenshots above.
use Marshmallow\BooleanGroup\BooleanGroup; BooleanGroup::make(__('From Marshmallow'), 'field_3')->options([ 'option_1' => '<strong>Option 1</strong><br/><small>With HTML</small>', 'option_2' => '<strong>Option 2</strong><br/><small>With HTML</small>', 'option_3' => '<strong>Option 3</strong><br/><small>With HTML</small>', ]),
Click area
By default, the clickable area within the border is full width. This sometimes creates an issue where users click this area without the intention to check of uncheck anything. If you want to change this behaviour, you can do so with the method below.
use Marshmallow\BooleanGroup\BooleanGroup; BooleanGroup::make(__('From Marshmallow'), 'field_3')->options([ // ... ])->cancelFullWidth(),
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
composer test
Security
If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.