rcknr/nova-multiselect-filter

A Laravel Nova filter that allows multiple selection.

Installs: 63 371

Dependents: 2

Suggesters: 0

Security: 0

Stars: 26

Watchers: 2

Forks: 11

Open Issues: 17

Language:Vue


README

Provides capability of selecting multiple values with Nova Resource filter.

Nova Multiselect Field

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require rcknr/nova-multiselect-filter

Usage

Use MultiselectFilter class instead of Filter:

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