mahi/spatie-tags-nova-filter

A Laravel Nova filter for Spatie/Laravel-Tags.

Downloads

9122

Stars

3

Version

0.0.8

SpatieTagsNovaFilter

This package allows you to filter resources by tags. (using the awesome Spatie/laravel-tags and Vue-MultiSelect )

Installation

First you must install spatie/laravel-tags into your Laravel app. Here are the installation instructions for that package.

Next, you can install this package in to a Laravel app that uses Nova via composer:

composer require mahi/spatie-tags-nova-filter

Usage

After the package has been installed with Composer, simply register the filter in your resource:

use Mahi\SpatieTagsNovaFilter\SpatieTagsNovaFilter;

class MyResource extends Resource
{
    /**
     * Get the filters available for the resource.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function filters(Request $request)
    {
        return [
            (new SpatieTagsNovaFilter)
                ->label('Tags')
                ->withMeta([
                    'withAnyTags' => false,
                    'tag_type' => null
                ])
        ];
    }
}

License

The MIT License (MIT). Please see License File for more information.

Mahi-Mahi

Author

Mahi-Mahi