bessamu/ajax-multiselect-nova-field is a Laravel package for a laravel nova field..
It currently has 5 GitHub stars and 42.338 downloads on Packagist (latest version 1.2.3).
Install it with composer require bessamu/ajax-multiselect-nova-field.
Discover more Laravel packages by bessamu
or browse all Laravel packages to compare alternatives.
Last updated
Laravel Nova package add vue-multiselect field work with ajax requests. Field values save as json string.

Install the package in a project via composer:
composer require bessamu/ajax-multiselect-nova-field
Ajax multiselect field have a model option for searching by ajax queries.
<?php
namespace App\Nova;
use App\Models\Catalog\Product;
use Bessamu\AjaxMultiselectNovaField\AjaxMultiselect;
class NewsResource extends Resource
{
public function fields(Request $request)
{
return [
AjaxMultiselect::make('Products', 'products')
->optionsModel(Product::class)
->optionsLabel('model')
->queryWhere('enabled', 1)
->placeholder('Select products')
->maxOptions(5)
];
}
}
Option optionsModel required for this nova field:
Illuminate\Database\Eloquent\Model.Values saved as json string in a column.
| option | required | parameters | description |
|------------------|----------|------------------------|------------------------------------------------------------------------------------------------------|
| optionsModel() | require | string $modelClass | Set a model class to search. |
| optionsLabel() | optional | string $searchLabel | Set a label for frontend output and search models. By default searching label is 'name'. |
| queryWhere() | optional | string $column, string $value, string $operator = '=' | Set query by a column, value and operator |
| placeholder() | optional | string $placeholder | Set a placeholder for vue-multiselect input. |
| maxOptions() | optional | int $max | Set the maximal number of selections and limit returned models |
| orderBy() | optional | string $column, string $direction = 'asc' | Order your outputs by column name and use direction asc(default) or desc.|
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details