Skip to content

Provides capability of selecting multiple values with Nova Resource filter.

Notifications You must be signed in to change notification settings

rcknr/nova-multiselect-filter

Repository files navigation

Nova Multiselect Filter

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

About

Provides capability of selecting multiple values with Nova Resource filter.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •