Download the PHP package fourstacks/nova-checkboxes without Composer

On this page you can find all versions of the php package fourstacks/nova-checkboxes. 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-checkboxes

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

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

You can install this package in to a Laravel app that uses Nova via composer:

Examples

Nova checkboxes on Nova index view (with displayUncheckedValuesOnIndex option) Nova checkboxes on Nova index view (with displayUncheckedValuesOnIndex option)

Nova checkboxes on Nova detail view Nova checkboxes on Nova detail view

Nova checkboxes on Nova form view Nova checkboxes on Nova form

Usage

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

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:

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

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

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:

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:

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:

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

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:

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

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:

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

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.

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

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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


All versions of nova-checkboxes with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
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 fourstacks/nova-checkboxes contains the following files

Loading the files please wait ....