balajidharma/laravel-category
Laravel nestable custom categories
14,812
1
| Install | |
|---|---|
composer require balajidharma/laravel-category |
|
| Latest Version: | v3.0.1 |
| Laravel: | 12 · 13 |
| Older releases: | 8 – 11 |
| License: | MIT |
| Last Updated: | May 14, 2026 |
| Links: | GitHub · Packagist |
Maintainer: balajidharma
Laravel Category
Create database-based Category to your Laravel projects.
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');
Related Packages
fbf/laravel-categories
A Laravel 4 package for adding one or more types of category hierarchies to a we...
576
16
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| v3.0.1 | ^12.0| | MIT | |
| v2.0.10 | ^10.0| | MIT | |
| v2.0.9 | ^10.0| | MIT | |
| v2.0.8 | ^8.71| | MIT | |
| v2.0.7 | ^8.71| | MIT | |
| v2.0.6 | ^8.71| | MIT | |
| v2.0.5 | ^8.71| | MIT | |
| v2.0.4 | ^8.71| | MIT | |
| v2.0.3 | ^8.71| | MIT | |
| v2.0.2 | ^8.71| | MIT | |
| v2.0.1 | ^8.71| | MIT | |
| v1.0.8 | ^8.71| | MIT | |
| v1.0.7 | ^8.71| | MIT | |
| v1.0.6 | ^8.71| | MIT | |
| v1.0.5 | ^8.71| | MIT | |
| v1.0.4 | ^8.71| | MIT | |
| v1.0.3 | ^8.71| | MIT | |
| v1.0.2 | ^8.71| | MIT | |
| v1.0.1 | ^8.71| | MIT |