PHPackages                             zareismail/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. zareismail/nova-radio-field

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

zareismail/nova-radio-field
===========================

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

0.1.0(6y ago)1971MITVuePHP &gt;=7.1.0

Since Aug 23Pushed 6y agoCompare

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

READMEChangelog (1)DependenciesVersions (7)Used By (1)

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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.5% 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 ~118 days

Recently: every ~147 days

Total

6

Last Release

2230d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/188c6af1615930311adb86de0f0f1e9241b3306d8f7680c385caa6aa0810ca48?d=identicon)[zareismail](/maintainers/zareismail)

---

Top Contributors

[![OwenMelbz](https://avatars.githubusercontent.com/u/1094740?v=4)](https://github.com/OwenMelbz "OwenMelbz (24 commits)")[![Diddyy](https://avatars.githubusercontent.com/u/12849249?v=4)](https://github.com/Diddyy "Diddyy (13 commits)")[![donkfather](https://avatars.githubusercontent.com/u/4688239?v=4)](https://github.com/donkfather "donkfather (2 commits)")[![zareismail](https://avatars.githubusercontent.com/u/23401061?v=4)](https://github.com/zareismail "zareismail (2 commits)")

---

Tags

laravelnova

### Embed Badge

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

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

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[inspheric/nova-defaultable

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

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

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12218.4k](/packages/yieldstudio-nova-google-autocomplete)

PHPackages © 2026

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