PHPackages                             baykier/nova-radio-field - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. baykier/nova-radio-field

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

baykier/nova-radio-field
========================

A Laravel Nova radio button field type with the ability to toggle other field visibility.

0.0.6(6y ago)09MITVuePHP &gt;=7.1.0

Since Aug 23Pushed 6y agoCompare

[ Source](https://github.com/baykier/nova-radio-field)[ Packagist](https://packagist.org/packages/baykier/nova-radio-field)[ RSS](/packages/baykier-nova-radio-field/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (7)Used By (0)

Laravel Nova Radio Button Group Field Type
==========================================

[](#laravel-nova-radio-button-group-field-type)

This is a simple nova field type to introduce a radio button with the ability to toggle other field visibility.

Form View
---------

[](#form-view)

[![index view](https://camo.githubusercontent.com/82fd45efaeeee33481c273d45a72110b65d0cc93d6a1e87bbebd073b52e60a1a/68747470733a2f2f692e696d6775722e636f6d2f47624572764c472e706e67)](https://camo.githubusercontent.com/82fd45efaeeee33481c273d45a72110b65d0cc93d6a1e87bbebd073b52e60a1a/68747470733a2f2f692e696d6775722e636f6d2f47624572764c472e706e67)

Index View
----------

[](#index-view)

[![form view](https://camo.githubusercontent.com/c065e1df3bb329c01b9e5751a2b544d1aededc7e77689932fa0e286b14edb0f0/68747470733a2f2f692e696d6775722e636f6d2f524b536334786a2e706e67)](https://camo.githubusercontent.com/c065e1df3bb329c01b9e5751a2b544d1aededc7e77689932fa0e286b14edb0f0/68747470733a2f2f692e696d6775722e636f6d2f524b536334786a2e706e67)

Toggle Mode
-----------

[](#toggle-mode)

[![toggle mode](https://camo.githubusercontent.com/e1da00c852acee3ce80c47277cb801c39dc5ea1642bc6c377a32c05c57186e4d/68747470733a2f2f692e696d6775722e636f6d2f355877697433632e676966)](https://camo.githubusercontent.com/e1da00c852acee3ce80c47277cb801c39dc5ea1642bc6c377a32c05c57186e4d/68747470733a2f2f692e696d6775722e636f6d2f355877697433632e676966)

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

[](#installation)

`composer require owenmelbz/nova-radio-field`

Usage
-----

[](#usage)

```
use OwenMelbz\RadioField\RadioButton;

public function fields(Request $request)
{
    return [
        RadioButton::make('Can view skip adverts?')
            ->options([
                0 => 'No',
                1 => ['Yes' => 'This means that users will not have to watch adverts.'],
            ])
            ->default(0) // optional
            ->stack() // optional (required to show hints)
            ->marginBetween() // optional
            ->skipTransformation() // optional
            ->toggle([  // optional
                1 => ['max_skips', 'skip_sponsored'] // will hide max_skips and skip_sponsored when the value is 1
            ])
    ];
}
```

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

[](#configuration)

### options()

[](#options)

This accepts basic string/integer key-pair values. The key of the array will be saved in the database, and the value will be displayed.

If you assign an array to the value, it will act as a key-pair for a label and a hint when using `stack()`

[![hint view](https://camo.githubusercontent.com/21f10b07a983e73b96ae747d6573b3a38c54fba107a77e04ace62e2227d3caa8/68747470733a2f2f692e696d6775722e636f6d2f4e38616a6151452e6a7067)](https://camo.githubusercontent.com/21f10b07a983e73b96ae747d6573b3a38c54fba107a77e04ace62e2227d3caa8/68747470733a2f2f692e696d6775722e636f6d2f4e38616a6151452e6a7067)

### toggle()

[](#toggle)

This accepts an array, the key of the array represents the value of the field. The value of the item must always be an array of the fields you wish to hide, when this value is picked.

e.g. if this array was passed in, when the value is `1` the `email` field will be hidden, any other value will show everything.

```
toggle([
    1 => ['email']
])

```

### default()

[](#default)

This lets you set the default radio button, otherwise none will be selected - You just pass in the value of the key, e.g 0

### stack()

[](#stack)

By default the radios will sit next to each other, if you want them underneath in a longer list call the `stack()` method

### marginBetween()

[](#marginbetween)

If you happen to have lots of options that fold onto 2 lines, you might want to give them some spacing.

### skipTransformation()

[](#skiptransformation)

By default on the index and detail page we display the labelled value to the user, if you want to show the raw value instead, then call `skipTransformation()`

License
-------

[](#license)

Go crazy, do what you like :)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.9% 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 ~77 days

Recently: every ~96 days

Total

6

Last Release

2483d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12169649?v=4)[baykier](/maintainers/baykier)[@baykier](https://github.com/baykier)

---

Top Contributors

[![OwenMelbz](https://avatars.githubusercontent.com/u/1094740?v=4)](https://github.com/OwenMelbz "OwenMelbz (23 commits)")[![Diddyy](https://avatars.githubusercontent.com/u/12849249?v=4)](https://github.com/Diddyy "Diddyy (13 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/baykier-nova-radio-field/health.svg)

```
[![Health](https://phpackages.com/badges/baykier-nova-radio-field/health.svg)](https://phpackages.com/packages/baykier-nova-radio-field)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3423.6M8](/packages/optimistdigital-nova-multiselect-field)[inspheric/nova-defaultable

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

51177.6k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17178.1k1](/packages/murdercode-nova4-tinymce-editor)[datomatic/nova-detached-actions

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

11258.1k](/packages/datomatic-nova-detached-actions)[wemersonrv/input-mask

A Laravel Nova custom field text with masks on input

1197.8k](/packages/wemersonrv-input-mask)

PHPackages © 2026

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