kdrmlhcn/nova-multiselect-label-filter

Multiselect filter for Laravel Nova

v1.2.1 2020-04-02 10:31 UTC

This package is not auto-updated.

Last update: 2024-12-20 09:29:00 UTC


README

composer require kdrmlhcn/nova-multiselect-label-filter

Description

Multiselect label filter for Laravel Nova. Based on vue-multiselect

example

Usage

use Illuminate\Http\Request;
use Kdrmlhcn\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',
        ];
    }
}