PHPackages                             balajidharma/laravel-category - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. balajidharma/laravel-category

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

balajidharma/laravel-category
=============================

Laravel nestable custom categories

v2.0.10(7mo ago)112.1k↑30%3MITPHP

Since Aug 16Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/balajidharma/laravel-category)[ Packagist](https://packagist.org/packages/balajidharma/laravel-category)[ RSS](/packages/balajidharma-laravel-category/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (20)Used By (3)

Laravel Category
================

[](#laravel-category)

### Create database-based Category to your Laravel projects.

[](#create-database-based-category-to-your-laravel-projects)

[![Total Downloads](https://camo.githubusercontent.com/92ccb767bda1e4334c47d6c4d6029a0e24cbbeb8a89a60725b1072e04821b996/68747470733a2f2f706f7365722e707567782e6f72672f62616c616a69646861726d612f6c61726176656c2d63617465676f72792f646f776e6c6f616473)](https://packagist.org/packages/balajidharma/laravel-category)[![Latest Stable Version](https://camo.githubusercontent.com/92637c092524db2490f255f9f83c736ec976f0f8cde24ba1a4d412fa76b218e2/68747470733a2f2f706f7365722e707567782e6f72672f62616c616a69646861726d612f6c61726176656c2d63617465676f72792f762f737461626c65)](https://packagist.org/packages/balajidharma/laravel-category)[![License](https://camo.githubusercontent.com/525a735a54e3234073286c8192cace826cc2192dcfe6fe6235e26427dec779a2/68747470733a2f2f706f7365722e707567782e6f72672f62616c616a69646861726d612f6c61726176656c2d63617465676f72792f6c6963656e7365)](https://packagist.org/packages/balajidharma/laravel-category)

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Demo](#demo)
- [Create Category Type](#create-category-type)
- [Create Category](#create-category)
- [Create multiple Category](#create-multiple-menu-items)
- [Category Tree](#category-tree)

Installation
------------

[](#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
----

[](#demo)

The "[Basic Laravel Admin Penel](https://github.com/balajidharma/basic-laravel-admin-panel)" starter kit come with Laravel Category

Create Category Type
--------------------

[](#create-category-type)

```
use BalajiDharma\LaravelCategory\Models\CategoryType;

CategoryType::create([
    'name' => 'Product Category',
    'machine_name' => 'product_category',
    'description' => 'Site Product Category',
]);
```

Category Tree
-------------

[](#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');
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance65

Regular maintenance activity

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~44 days

Recently: every ~80 days

Total

19

Last Release

210d ago

Major Versions

v1.0.8 → v2.0.12024-05-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/659e364f468af984cb298c67c79b4d671d890aa226875f0090c360fd35fc1358?d=identicon)[balajidharma](/maintainers/balajidharma)

---

Top Contributors

[![balajidharma](https://avatars.githubusercontent.com/u/6037466?v=4)](https://github.com/balajidharma "balajidharma (35 commits)")

---

Tags

laravelcategorieslaravel-categorycategory-managerlaravel-category-manager

### Embed Badge

![Health badge](/badges/balajidharma-laravel-category/health.svg)

```
[![Health](https://phpackages.com/badges/balajidharma-laravel-category/health.svg)](https://phpackages.com/packages/balajidharma-laravel-category)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[aliziodev/laravel-taxonomy

Laravel Taxonomy is a flexible and powerful package for managing taxonomies, categories, tags, and hierarchical structures in Laravel applications. Features nested-set support for optimal query performance on hierarchical data structures.

23318.4k](/packages/aliziodev-laravel-taxonomy)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
