whereHasTaxonomy, whereHasTerm) integrate cleanly with existing repositories/services.spatie/laravel-tags) may suffice.spatie/laravel-tags.spatie/laravel-tags instead).pivot tables, custom solutions).Taxonomy::create(['name' => 'Product Categories'])).belongsToMany relationships with the package’s morphToMany (for polymorphic support).Post::whereHasTaxonomy('Blog', 'Featured')->get()).{{ $post->taxonomies->first()->name }}).term/taxonomy model names (configurable via config/taxonomies.php).softDeletes).pdo_mysql (or equivalent) and Laravel’s default extensions (e.g., bcmath for numeric taxonomies).composer require myerscode/laravel-taxonomies.php artisan vendor:publish --tag="taxonomies-config".model and table names in config/taxonomies.php if using custom models.use Myerscode\Taxonomies\Taxonomy;
Taxonomy::create(['name' => 'Product Types']);
use Myerscode\Taxonomies\HasTaxonomies;
class Product extends Model {
use HasTaxonomies;
}
morphToMany).taxonomy_term_model pivot table for performance.Cache::remember).composer.json until stability is proven.tinker to inspect taxonomy relationships:
$product = Product::find(1);
$product->taxonomies; // Load related taxonomies
with() to eager load taxonomies/terms:
Product::with(['taxonomies.terms'])->get();
Cache::remember('taxonomy:blog', now()->addHours(1), fn() => Taxonomy::where('name', 'Blog')->get());
How can I help you explore Laravel packages today?