Download the PHP package almirhodzic/nova-toggle-5 without Composer

On this page you can find all versions of the php package almirhodzic/nova-toggle-5. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-toggle-5

Laravel Nova 5 Toggle Field

This Laravel Nova 5 Toggle Field removes the detour into the edit page and lets you flip booleans directly in the index. Fewer clicks, less context switching, smoother workflow.

Laravel Nova 5 Toggle Field

License: MIT Nova 5 PHP 8.2+ Downloads

Features

Requirements

Installation

The service provider will be automatically registered.

Upgrading from 1.2 to 1.3

Version 1.3.0 contains a security fix that changes how the toggle endpoint is authorized. For most installations the upgrade is a drop-in: just run composer update almirhodzic/nova-toggle-5.

What changed:

If you were relying on the old guards config to grant toggle access to users that do not pass the viewNova gate, make sure those users are now either allowed by the gate or no longer need toggle access.

Basic Usage

Configuration

Colors

Toggle Background Colors

Bullet Colors

Labels

Custom ON/OFF Text

Label Colors

Toast Notifications

Custom Toast Label

By default, the toast message uses the resource's name, label, title, or the resource's singular label. You can customize which model attribute to use:

Default fallback order: namelabeltitle → resource singular label

Disable Toast Notifications

Filtering

To make your toggle field filterable in the index view, you need to create a custom filter.

Step 1: Create a Filter

Step 2: Implement the Filter

Step 3: Register the Filter in Your Resource

Alternative: Boolean Filter (Checkboxes)

If you prefer checkboxes instead of a dropdown:

Now use

Help Text

Add contextual help text for different views:

Visibility & Access Control

Hide Based on Condition

Readonly Based on Condition

Authorization

Toggle requests are protected by Nova's own API middleware, so only users who pass Nova's viewNova gate can reach the endpoint. On top of that, the controller enforces the resource's authorizedToUpdate policy and only allows writes to attributes that are actually exposed as a Toggle field on the resource (and are not readonly in the current context).

No additional configuration is required — the toggle follows the same access rules as Nova itself.

Complete Example

API Reference

Methods

Method Parameters Description
onColor() string $light, ?string $dark = null Background color when ON
offColor() string $light, ?string $dark = null Background color when OFF
onBullet() string $light, ?string $dark = null Bullet color when ON
offBullet() string $light, ?string $dark = null Bullet color when OFF
valueLabelText() ?string $onLabel = 'ON', ?string $offLabel = 'OFF' Custom label text
valueLabelOnColors() string $light, ?string $dark = null ON label color
valueLabelOffColors() string $light, ?string $dark = null OFF label color
toastShow() bool $show = true Show/hide toast notification on toggle
toastLabelKey() string $key Model attribute to use for toast label
hideWhen() callable $callback Hide field based on condition
readonlyWhen() callable $callback Make readonly based on condition
helpOnIndex() string $text Help text on index view
helpOnForm() string $text Help text on form view
helpOnDetail() string $text Help text on detail view

Default Colors

State Light Mode Dark Mode
ON Background #00d5be #009689
OFF Background #e5e5e5 #323f57
ON Bullet #ffffff #ffffff
OFF Bullet #ffffff #ffffff
ON Label #ffffff #ffffff
OFF Label #a1a1a1 #737373

Default Behavior

Option Default Value
toastShow true
toastLabelKey null (uses fallback: name → label → title → resource singular label)

Bug or Issues

Found a Bug or Issue? Please report here: GitHub Issues
We appreciate your feedback to help improve this package.

Support

License

The MIT License (MIT). Please see License File for more information.

Credits


By Frontbyte


All versions of nova-toggle-5 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package almirhodzic/nova-toggle-5 contains the following files

Loading the files please wait ...