Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

A checkbox/boolean field replacement for Laravel Nova.

Notifications You must be signed in to change notification settings

gobrightspot/nova-tickbox-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Nova Tickbox Field

Status: ABANDONED No Maintenance Intended

Deprecation Notice⚠️

GoBrightspot is no longer maintaining this project. Please fork it to continue development.

Introduction

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.

Installation

composer require gobrightspot/nova-tickbox-field

Basic Usage

use Brightspot\Nova\Fields\Tickbox\Tickbox;

...

public function fields(Request $request)
{
    return [
        Tickbox::make('Are you a duck?', 'is_a_duck')
    ];
}

Custom Labels

public function fields(Request $request)
{
    return [
        Tickbox::make('Are you a duck?', 'is_a_duck')->labels('Definitely a duck', 'Probably not a duck');
    ];
}

Only Customize the True Label

public function fields(Request $request)
{
    return [
        Tickbox::make('Are you a duck?', 'is_a_duck')->trueLabel('Definitely a duck');
    ];
}

Only Customize the False Label

public function fields(Request $request)
{
    return [
        Tickbox::make('Are you a duck?', 'is_a_duck')->falseLabel('Probably not a duck');
    ];
}

About

A checkbox/boolean field replacement for Laravel Nova.

Resources

Stars

Watchers

Forks

Packages

No packages published