Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Taxonomy Laravel Package

aliziodev/laravel-taxonomy

Flexible Laravel package for managing taxonomies, categories, tags, and hierarchical trees. Includes nested-set support for fast hierarchy queries, metadata, bulk operations, caching, and custom taxonomy types. Compatible with Laravel 11+.

View on GitHub
Deep Wiki
Context7
2.0.0

🚀 Fitur Utama yang Ditambahkan

Implementasi Nested Set Model

  • Menambahkan dukungan lengkap Nested Set Model untuk manajemen data hierarkis
  • Mengimplementasikan kalkulasi otomatis batas kiri/kanan (field lft, rgt, depth)
  • Menambahkan metode traversal tree yang efisien untuk ancestors, descendants, dan siblings
  • Mengintegrasikan pemeliharaan nested set otomatis pada operasi create, update, dan delete

Optimisasi Performa

  • Menambahkan dukungan operasi bulk untuk manajemen taxonomy skala besar
  • Mengimplementasikan rebuilding tree yang efisien dengan metode rebuildNestedSet()
  • Menambahkan monitoring performa dan kemampuan benchmarking
  • Mengoptimalkan query database menggunakan batas nested set alih-alih query rekursif

Operasi Tree Lanjutan

  • Menambahkan metode moveToParent() untuk reposisi node yang efisien
  • Mengimplementasikan cascade delete dengan pencegahan orphan
  • Menambahkan validasi tree dan pengecekan integritas
  • Dukungan untuk operasi concurrent dengan penanganan race condition

Console Commands

  • Menambahkan command taxonomy:rebuild-nested-set untuk rebuilding nilai nested set
  • Meningkatkan command taxonomy:install dengan error handling yang lebih baik

🔧 Peningkatan Teknis

Peningkatan Skema Database

-- Menambahkan field nested set ke tabel taxonomies
ALTER TABLE taxonomies ADD COLUMN lft INTEGER;
ALTER TABLE taxonomies ADD COLUMN rgt INTEGER;
ALTER TABLE taxonomies ADD COLUMN depth INTEGER DEFAULT 0;

-- Menambahkan index untuk performa
CREATE INDEX idx_taxonomies_nested_set ON taxonomies(type, lft, rgt);
CREATE INDEX idx_taxonomies_parent ON taxonomies(parent_id);

Peningkatan Model

  • Meningkatkan model Taxonomy dengan metode nested set:
    • getAncestors() - Mendapatkan semua node parent
    • getDescendants() - Mendapatkan semua node child
    • getSiblings() - Mendapatkan node di level yang sama
    • getNestedTree() - Mendapatkan struktur tree lengkap
    • isAncestorOf() - Mengecek hubungan parent-child
    • isDescendantOf() - Mengecek hubungan child-parent

Peningkatan Service Layer

  • Menambahkan service TaxonomyManager untuk operasi kompleks
  • Mengimplementasikan operasi transaction-safe untuk integritas data
  • Menambahkan kemampuan batch processing untuk dataset besar
  • Meningkatkan error handling dengan custom exceptions

🧪 Infrastruktur Testing

Test Suite Komprehensif

  • Menambahkan ExtremeTaxonomyTest untuk edge cases dan dataset besar
  • Menambahkan TaxonomyPerformanceTest untuk benchmarking performa
  • Menambahkan TaxonomyConcurrencyTest untuk testing race condition
  • Menambahkan NestedSetTest untuk operasi spesifik nested set

Coverage Test Performa

  • Testing efisiensi operasi move dengan assertion waktu
  • Performa retrieval descendants untuk berbagai ukuran tree
  • Operasi delete dengan cascade dan pencegahan orphan
  • Monitoring penggunaan memori untuk operasi besar
  • Penanganan operasi concurrent dengan transaksi database

📊 Metrik Performa

Sebelum Nested Set (v1.x)

  • Traversal tree: O(n) query rekursif
  • Retrieval ancestor: Multiple database hits
  • Operasi move: Update parent_id yang mahal
  • Tree besar: Degradasi performa

Setelah Nested Set (v2.0)

  • Traversal tree: O(1) single query dengan boundaries
  • Retrieval ancestor: Single query dengan perbandingan lft/rgt
  • Operasi move: Rekalkulasi boundary yang efisien
  • Tree besar: Performa konsisten hingga 10,000+ nodes

🔄 Panduan Migrasi

Migrasi Database

# Jalankan migrasi untuk menambahkan field nested set
php artisan migrate

# Rebuild nilai nested set untuk data yang sudah ada
php artisan taxonomy:rebuild-nested-set

# Rebuild tipe taxonomy tertentu
php artisan taxonomy:rebuild-nested-set category

# Force rebuild tanpa konfirmasi
php artisan taxonomy:rebuild-nested-set --force

Update Kode

// Cara lama (v1.x)
$children = $taxonomy->children;
$ancestors = $this->getAncestorsRecursively($taxonomy);

// Cara baru (v2.0)
$children = $taxonomy->getDescendants();
$ancestors = $taxonomy->getAncestors();

⚠️ Breaking Changes

  • Perubahan skema database memerlukan migrasi
  • Beberapa signature metode berubah untuk konsistensi
  • Threshold test performa mungkin perlu penyesuaian untuk environment berbeda
  • Perilaku soft delete dimodifikasi untuk integritas nested set

🐛 Perbaikan Bug

  • Memperbaiki race conditions dalam operasi move concurrent
  • Mengatasi masalah orphan node dalam operasi delete
  • Memperbaiki korupsi boundary nested set dalam edge cases
  • Mengoreksi assertion test performa untuk ekspektasi yang realistis

📚 Dokumentasi

  • Menambahkan dokumentasi API komprehensif untuk semua metode nested set
  • Membuat panduan benchmarking performa dengan tips optimisasi
  • Menambahkan panduan migrasi untuk upgrade dari v1.x
  • Meningkatkan README dengan contoh penggunaan nested set

1.0.0

Rilis Awal

  • Manajemen taxonomy dasar dengan hubungan parent-child
  • Operasi CRUD sederhana
  • Query hierarkis dasar menggunakan parent_id
  • Dukungan soft delete
  • Dukungan multi-type taxonomy (categories, tags, dll.)
2.9.0

Features

  • implement core taxonomy package with nested set support and comprehensive test suite (df9503a)
  • implement core taxonomy system including models, traits, commands, and comprehensive test suite (e1e7295)
2.8.0

Bug Fixes

  • database: modify unique constraint to exclude soft-deleted records (3097332)

Features

  • model: handle slug conflicts and cache clearing on restore (d0035cc)
  • taxonomy: add slug handling options for soft-deleted records (0e22f5d)
2.7.0

Features

  • migrations: add configurable migration loading for taxonomy (69d8cdc)

Performance Improvements

  • TaxonomyManager: improve cache invalidation strategy (54ccbe6)
2.6.1

Bug Fixes

  • database: use dynamic table names for taxonomy foreign keys #10 (2908957)
2.6.0

Features

  • taxonomy: add type-specific operations and query scopes (20cf611)
  • taxonomy: add type-specific taxonomy relationship methods (ee31d44)
2.5.0

Features

  • refactor to configurable model and merged PR #8 (#9) (409cbe7)
2.4.8

Bug Fixes

  • taxonomies: relation return model from config (#7) (5c9b85e)
2.4.7

Bug Fixes

  • ci: resolve composer dependency management issues in workflows (3e46e8d)
2.4.6

Bug Fixes

  • workflows: remove invalid --prefer-stable flag from composer install (4b7a17d)
2.4.5

Bug Fixes

  • workflows: prevent orchestra/testbench dependency placement issues (8b5e7e7)
2.4.4

Bug Fixes

  • composer: move again orchestra/testbench to require-dev (2fc16b0)
  • release: remove composer.json from semantic-release assets (8f3b2db)
2.4.3

Bug Fixes

  • ci: install orchestra/testbench as dev dependency in all workflows (4c52711)
2.4.2

Bug Fixes

  • composer: move orchestra/testbench to require-dev section (dc5a1a7)
2.4.1

Bug Fixes

  • taxonomy: include type in DuplicateSlugException for better error context (67cdd43)
2.4.0

Bug Fixes

  • Taxonomy: include type in DuplicateSlugException for better error context (6665b4e)

Features

  • exceptions: add type context to DuplicateSlugException for better debugging (defd29b)
2.3.0

⚠ BREAKING CHANGES

  • implement composite unique slugs for taxonomies

Features

  • implement composite unique slugs for taxonomies (c7c6d58)
2.2.1

Bug Fixes

2.2.0

Features

  • HasTaxonomy: add taxonomy scopes for filtering models (5cc5a78)
  • Taxonomy: add getSiblings method to retrieve same-level taxonomies (4756c1a)
2.10.0

Features

  • add type-specific taxonomy management methods to HasTaxonomy trait with supporting tests (7914b53)
2.1.0

Features

  • implement automated changelog system (0c8c6c0)
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nasirkhan/laravel-sharekit
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony