Tenant-aware tag management and Filament administration for Vendra
misaf/vendra-tagger is a Laravel package for tenant-aware tag management and filament administration for vendra.
It currently has 1 GitHub stars and 11 downloads on Packagist (latest version v1.10.0).
Install it with composer require misaf/vendra-tagger.
Discover more Laravel packages by misaf
or browse all Laravel packages to compare alternatives.
Last updated
Translated, sortable, and tenant-compatible tag management for Vendra applications, with a Filament administration resource built on spatie/laravel-tags.
position column in place of Spatie's order_columnmisaf/vendra-support^8.3^13.0^5.6.8filament/spatie-laravel-tags-plugin ^5.6.8misaf/vendra-support ^1.0composer require misaf/vendra-tagger
php artisan vendor:publish --tag=tags-migrations
php artisan vendor:publish --tag=vendra-tagger-migrations
php artisan migrate
Configure Spatie Tags to use the Vendra model in config/tags.php:
use Misaf\VendraTagger\Models\Tagger;
return [
'tag_model' => Tagger::class,
];
The package service provider and Filament plugin are auto-discovered. Optionally publish the package configuration and translations:
php artisan vendor:publish --tag=vendra-tagger-config
php artisan vendor:publish --tag=vendra-tagger-translations
Seed the tag-management permissions when the Vendra permission module is installed:
php artisan vendra-tagger:seed
config/vendra-tagger.php exposes two integration options:
return [
'panels' => ['admin'],
'navigation_group' => 'vendra-support::navigation.groups.Content',
];
panels accepts one panel ID or an array of IDs. navigation_group accepts a translation key or literal label and can also be overridden through TaggerPlugin::navigationGroup().
Tenant awareness is not configured here. When a tenant provider binds an available TenantResolver, the package adds and scopes tenant_id; otherwise it operates without tenant ownership.
Create a tag:
use Misaf\VendraTagger\Models\Tagger;
$tag = Tagger::findOrCreate('Featured', type: 'content', locale: 'en');
Create a tag with an explicit translated slug:
$tag = Tagger::query()->create([
'name' => ['en' => 'Featured products'],
'slug' => ['en' => 'hand-picked'],
'type' => 'content',
]);
Load ordered tags by type:
$tags = Tagger::withType('content')->get();
Attach tags to an Eloquent model using Spatie's trait:
use Illuminate\Database\Eloquent\Model;
use Spatie\Tags\HasTags;
final class Article extends Model
{
use HasTags;
}
$article->attachTag('Featured', 'content');
Tagger binds the shared Support TagResolver. Product, User, Blog, Affiliate, Attribute, and FAQ detect that capability and enable their tag relations and Filament fields without depending on this package.
Create tags with the consumer's reserved type (product, user, blog, affiliate, attribute, or faq):
$tag = Tagger::findOrCreate('Featured', type: 'product', locale: 'en');
Do not add Product imports or dependencies to Tagger. Shared relationship metadata belongs to misaf/vendra-support.
By default, tag management is available on the admin panel in the shared Content navigation group. The resource supports translated name and slug editing, filtering, sorting, and drag-and-drop position updates. Names and slugs are validated within the current tenant and tag type; the type itself may be reused by any number of tags.
From a standalone package checkout:
composer test
composer analyse
From the Vendra monorepo:
vendor/bin/pest packages/vendra-tagger/tests
vendor/bin/phpstan analyse packages/vendra-tagger/src packages/vendra-tagger/database --memory-limit=2G
MIT. See LICENSE.