GoBrightspot is no longer maintaining this project. Please fork it to continue development.
In the Nova Index view, the Boolean field will display a green dot for True and a red dot for false. We wanted to be able to label the data on the Index view to 'Yes' and 'No'. You, surprisingly, can't do that in Nova (as of v2.0.1) hopefully they'll add that soon and our package will no longer be necessary, until then, enjoy.
composer require gobrightspot/nova-tickbox-field
use Brightspot\Nova\Fields\Tickbox\Tickbox;
...
public function fields(Request $request)
{
return [
Tickbox::make('Are you a duck?', 'is_a_duck')
];
}
public function fields(Request $request)
{
return [
Tickbox::make('Are you a duck?', 'is_a_duck')->labels('Definitely a duck', 'Probably not a duck');
];
}
public function fields(Request $request)
{
return [
Tickbox::make('Are you a duck?', 'is_a_duck')->trueLabel('Definitely a duck');
];
}
public function fields(Request $request)
{
return [
Tickbox::make('Are you a duck?', 'is_a_duck')->falseLabel('Probably not a duck');
];
}