Downloads
Stars
Version
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
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
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
])
];
}
}
The MIT License (MIT). Please see License File for more information.