klepak/nova-multiselect-filter

Multiselect filter for Laravel Nova

v1.2.2 2020-09-11 13:58 UTC

This package is auto-updated.

Last update: 2020-10-28 10:21:34 UTC


README

composer require klepak/nova-multiselect-filter

Description

Multiselect filter for Laravel Nova. Based on vue-multiselect

example

Usage

use Illuminate\Http\Request;
use Klepak\NovaMultiselectFilter\NovaMultiselectFilter;

class CustomFilter extends NovaMultiselectFilter
{
    public function apply(Request $request, $query, $value)
    {
        return $query->whereIn('field', $value);
    }

    public function options(Request $request)
    {
        return [
            'Label 1' => 'value-1',
            'Label 2' => 'value-2',
            'Label 3' => 'value-3',
        ];
    }
}

Testing

composer test