stealthpro / ajax-multiselect-nova-field
A Laravel Nova field.
Installs: 506
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2024-11-08 01:55:10 UTC
README
Laravel Nova package add vue-multiselect field work with ajax requests. Field values save as json string.
Getting Started
Installing
Install the package in a project via composer:
composer require stealthpro/ajax-multiselect-nova-field
Usage
Ajax multiselect field have a model
option for searching by ajax queries.
<?php namespace App\Nova; use App\Models\Catalog\Product; use Stealthpro\AjaxMultiselectNovaField\AjaxMultiselect; class NewsResource extends Resource { public function fields(Request $request) { return [ AjaxMultiselect::make('Products', 'products') ->optionsModel(Product::class) ->optionsLabel('model') ->placeholder('Select products') ->maxOptions(5) ]; } }
Option optionsModel
required for this nova field:
- Parameter is model class string, must be extended by
Illuminate\Database\Eloquent\Model
.
Values saved as json string in a column.
All options
License
This project is licensed under the MIT License - see the LICENSE.md file for details