Skip to content
This repository was archived by the owner on Sep 15, 2023. It is now read-only.

Latest commit

 

History

History
29 lines (22 loc) · 1.01 KB

README.md

File metadata and controls

29 lines (22 loc) · 1.01 KB

MultiSelect

Install

composer require ziffdavis/nova-multiselect

Description

Allows having a BelongsToMany relationship MultiSelect Form Field powered by Selectize. This field is hidden on the index page.

Usage

public function fields(Request $request)
{
    return [
        MultiSelect::make('Category', 'categories')->options(\App\Models\Category::get(['id', 'name']))->placeHolder('Select Categories'),
    ];
}

Methods

Method Description
options($options) Sets the options to use. May be a collection or array of Objects
placeHolder($text) Sets the text to use as the palce holder
disabled($bool) Sets whether or not the field is disabled
optionLabel($label) Sets the attribute name to use for the option label (Default 'name')
optionValue($value) Sets the attribute name to use for the option value (Default 'id')