helios-live / php-nova-spatie-tags-filter
A Laravel Nova filter.
Installs: 73
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: ^7.3|^8.0
- laravel/nova: ^4.0
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.