PHP code example of kdrmlhcn / nova-multiselect-label-filter

1. Go to this page and download the library: Download kdrmlhcn/nova-multiselect-label-filter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kdrmlhcn / nova-multiselect-label-filter example snippets


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',
        ];
    }
}