PHPackages                             fourstacks/nova-checkboxes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fourstacks/nova-checkboxes

AbandonedArchivedLibrary

fourstacks/nova-checkboxes
==========================

A Laravel Nova field.

v0.1.7(6y ago)91922.7k↓16%24[4 issues](https://github.com/fourstacks/nova-checkboxes/issues)[2 PRs](https://github.com/fourstacks/nova-checkboxes/pulls)1MITPHPPHP &gt;=7.1.0

Since Aug 26Pushed 3y ago2 watchersCompare

[ Source](https://github.com/fourstacks/nova-checkboxes)[ Packagist](https://packagist.org/packages/fourstacks/nova-checkboxes)[ RSS](/packages/fourstacks-nova-checkboxes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (1)

*NOTE*

There is now a native field in Nova called Boolean Group that replicates this field when using the `saveUncheckedValues` option. It is recommended that if you are using this package with that option enabled that you switch to the native Nova field as this package is only sporadically maintained.

---

A checkbox field for Nova apps
==============================

[](#a-checkbox-field-for-nova-apps)

This package contains a Laravel Nova field to add an array of checkboxes to your Nova resource forms and display the input from these fields.

Installation
------------

[](#installation)

You can install this package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require fourstacks/nova-checkboxes
```

Examples
--------

[](#examples)

[![Nova checkboxes on Nova index view (with displayUncheckedValuesOnIndex option)](https://raw.githubusercontent.com/fourstacks/nova-checkboxes/master/screenshot-index.png)](https://raw.githubusercontent.com/fourstacks/nova-checkboxes/master/screenshot-index.png)Nova checkboxes on Nova index view (with `displayUncheckedValuesOnIndex` option)

[![Nova checkboxes on Nova detail view](https://raw.githubusercontent.com/fourstacks/nova-checkboxes/master/screenshot-detail.png)](https://raw.githubusercontent.com/fourstacks/nova-checkboxes/master/screenshot-detail.png)Nova checkboxes on Nova detail view

[![Nova checkboxes on Nova form view](https://raw.githubusercontent.com/fourstacks/nova-checkboxes/master/screenshot-form.png)](https://raw.githubusercontent.com/fourstacks/nova-checkboxes/master/screenshot-form.png)Nova checkboxes on Nova form

Usage
-----

[](#usage)

To add a checkbox field, use the `Fourstacks\NovaCheckboxes\Checkboxes` field in your Nova resource:

```
namespace App\Nova;

use Fourstacks\NovaCheckboxes\Checkboxes;

// ...

class Member extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            Checkboxes::make('Hobbies'),

            // ...
        ];
    }
}
```

If you wish to use this package in it's default configuration then you should also ensure the Eloquent model that your Nova resource represents is casting the attribute you wish to use a checkbox field for, to an array:

```
namespace App;

// ...

class Member extends Model
{
    protected $casts = [
        'hobbies' => 'array'
    ]
}
```

The exception to this is if you choose to use the `saveAsString` option (see configuration below), in which case you should make sure that you are not casting this attribute to an array.

Configuration
-------------

[](#configuration)

This package comes with various options that you can use to customise how the values from checkbox fields are saved and displayed:

#### options

[](#options)

Parameters: `array`

Every checkbox field you create should contain `options`. These control the checkboxes that appear on your form and are comprised of a label and an underlying value:

```
Checkboxes::make('Hobbies')
    ->options([
        'sailing' => 'Sailing',
        'rock_climbing' => 'Rock Climbing',
        'archery' => 'Archery'
    ])
```

#### saveAsString

[](#saveasstring)

By default, this package will save checked items from this field to an array, in the attributes column in your database:

`[sailing,rock_climbing]`

This requires that you have set the `$casts` property on your eloquent model to an array (see Usage).

However if you wish you can instead save checked items as a simple comma separated string:

`sailing,rock_climbing`

Use the following option to achieve this:

```
Checkboxes::make('Hobbies')
    ->options([
        'sailing' => 'Sailing',
        'rock_climbing' => 'Rock Climbing',
        'archery' => 'Archery'
    ])
    ->saveAsString()
```

#### saveUncheckedValues

[](#saveuncheckedvalues)

By default, this field will only save checked items to the database. However if you wish to save all options that you have set along with whether they are checked or not you can do so by adding this option:

```
Checkboxes::make('Hobbies')
    ->options([
        'sailing' => 'Sailing',
        'rock_climbing' => 'Rock Climbing',
        'archery' => 'Archery'
    ])
    ->saveUncheckedValues()
```

This will save results to your database as an object:

`{sailing:true,rock_climbing:false,archery:true}`

Note that in order to use this option you cannot also use the `saveAsString` option - it's one or the other. Also you must ensure that you have set the `$casts` property on your eloquent model to an array (see Usage).

#### displayUncheckedValuesOnIndex

[](#displayuncheckedvaluesonindex)

By default, only the checked options will display on the index. If you wish to display all the options for this field along with their checked/unchecked status you can add this option:

```
Checkboxes::make('Hobbies')
    ->options([
        'sailing' => 'Sailing',
        'rock_climbing' => 'Rock Climbing',
        'archery' => 'Archery'
    ])
    ->displayUncheckedValuesOnIndex()
```

Note that this does NOT require you to save all unchecked values also using `saveUncheckedValues`. You can use any of the approaches to saving data along with this option.

#### displayUncheckedValuesOnDetail

[](#displayuncheckedvaluesondetail)

By default, only the checked options will display on detail screens. If you wish to display all the options for this field along with their checked/unchecked status you can add this option:

```
Checkboxes::make('Hobbies')
    ->options([
        'sailing' => 'Sailing',
        'rock_climbing' => 'Rock Climbing',
        'archery' => 'Archery'
    ])
    ->displayUncheckedValuesOnDetail()
```

Note that this does NOT require you to save all unchecked values also using `saveUncheckedValues`. You can use any of the approaches to saving data along with this option.

#### Display checkbox in columns

[](#display-checkbox-in-columns)

By default, only checked values are displayed in one column, but if you have enough space you can split them in many using the `columns` method on the field.

```
Checkboxes::make('Hobbies')
    ->options([
        'sailing' => 'Sailing',
        'rock_climbing' => 'Rock Climbing',
        'archery' => 'Archery'
    ])
    ->columns(3)
```

This will render at most 3 columns with values. So if you have 8 values selected you will see 3 columns with 3, 3 and 2 values.

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [John Wyles](https://github.com/fourstacks)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity53

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~77 days

Total

14

Last Release

2344d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5ee2ab177fdfe9be1bd27726f5b6e8de087479e0e220c492c2e464980b9c7e5?d=identicon)[fourstacks](/maintainers/fourstacks)

---

Top Contributors

[![fourstacks](https://avatars.githubusercontent.com/u/6280211?v=4)](https://github.com/fourstacks "fourstacks (34 commits)")[![BrandonSurowiec](https://avatars.githubusercontent.com/u/5625680?v=4)](https://github.com/BrandonSurowiec "BrandonSurowiec (8 commits)")[![t1sh0o](https://avatars.githubusercontent.com/u/3911728?v=4)](https://github.com/t1sh0o "t1sh0o (3 commits)")[![batFormat](https://avatars.githubusercontent.com/u/13119245?v=4)](https://github.com/batFormat "batFormat (3 commits)")[![pbrisson](https://avatars.githubusercontent.com/u/3892766?v=4)](https://github.com/pbrisson "pbrisson (1 commits)")[![royduin](https://avatars.githubusercontent.com/u/1703233?v=4)](https://github.com/royduin "royduin (1 commits)")[![StanAngeloff](https://avatars.githubusercontent.com/u/93127?v=4)](https://github.com/StanAngeloff "StanAngeloff (1 commits)")

---

Tags

laravelnova

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fourstacks-nova-checkboxes/health.svg)

```
[![Health](https://phpackages.com/badges/fourstacks-nova-checkboxes/health.svg)](https://phpackages.com/packages/fourstacks-nova-checkboxes)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[coreproc/nova-notification-feed

A Laravel Nova package that adds a notification feed in your Nova app.

10149.1k](/packages/coreproc-nova-notification-feed)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[cybercog/laravel-nova-ban

A Laravel Nova banning functionality for your application.

40199.8k](/packages/cybercog-laravel-nova-ban)[insenseanalytics/nova-server-monitor

A Laravel Nova tool for Spatie's Server Monitor library.

6546.9k](/packages/insenseanalytics-nova-server-monitor)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
