balajidharma/laravel-category
Laravel nestable custom categories
Maintainers
v3.0.1
2026-05-13 00:50 UTC
Requires
- balajidharma/laravel-media-manager: ^2.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT ab3ca18cd1aead80738e3fb38c1f69a935124917
categorieslaravellaravel-categorycategory-managerlaravel-category-manager
README
Create database-based Category to your Laravel projects.
👁 Total Downloads
👁 Latest Stable Version
👁 License
Table of Contents
Installation
- Install the package via composer
composer require balajidharma/laravel-category
- Publish the migration and the config/category.php config file with
php artisan vendor:publish --provider="BalajiDharma\LaravelCategory\CategoryServiceProvider"
- Run the migrations
php artisan migrate
Demo
The "Basic Laravel Admin Penel" starter kit come with Laravel Category
Create Category Type
use BalajiDharma\LaravelCategory\Models\CategoryType; CategoryType::create([ 'name' => 'Product Category', 'machine_name' => 'product_category', 'description' => 'Site Product Category', ]);
Category Tree
- Get a category tree by using category type id
use BalajiDharma\LaravelCategory\Models\Category; $items = (new Category)->toTree($type->id);
- Get a category tree by using the category machine name
use BalajiDharma\LaravelCategory\Models\CategoryType; $items = CategoryType::getCategoryTree('product_category');
