helios-live/php-nova-spatie-tags-filter

A Laravel Nova filter.

Installs: 7 309

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Vue

pkg:composer/helios-live/php-nova-spatie-tags-filter

v1.0.1 2024-01-29 17:00 UTC

This package is auto-updated.

Last update: 2025-09-29 03:20:17 UTC


README

Works with Laravel Nova 4.
Borrowed heavily from https://github.com/Mahi-Mahi/SpatieTagsNovaFilter.

This package allows you to filter resources by tags.

Using the awesome Spatie/laravel-tags and vueform/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 helios-live/php-nova-spatie-tags-filter

Usage

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

use HeliosLive\PhpNovaSpatieTagsFilter\PhpNovaSpatieTagsFilter;

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 PhpNovaSpatieTagsFilter)
                ->label('Tags')
                // ->placeholder('')
                ->withMeta([
                    'withAnyTags' => true, // true, false, "never"
                    'tag_type' => null
                ])
        ];
    }
}

License

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