PHP code example of rcknr / nova-multiselect-filter

1. Go to this page and download the library: Download rcknr/nova-multiselect-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/ */

    

rcknr / nova-multiselect-filter example snippets


use rcknr\Nova\Filters\MultiselectFilter;

class UserType extends MultiselectFilter
{
  public function apply(Request $request, $query, $value)
  {
      return $query->whereIn('user_role', $value);
  }

  public function options(Request $request)
  {
      return [
          'Administrator' => 'admin',
          'Editor' => 'editor',
      ];
  }
}