PHPackages                             delatbabel/nestedcategories - 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. [Database &amp; ORM](/categories/database)
4. /
5. delatbabel/nestedcategories

ActiveLibrary[Database &amp; ORM](/categories/database)

delatbabel/nestedcategories
===========================

A Laravel 5 package for nested categories.

v1.1(9y ago)31.4k22MITPHPPHP &gt;=5.4.0

Since Feb 2Pushed 8y ago2 watchersCompare

[ Source](https://github.com/delatbabel/nestedcategories)[ Packagist](https://packagist.org/packages/delatbabel/nestedcategories)[ RSS](/packages/delatbabel-nestedcategories/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (10)Used By (2)

nestedcategories
================

[](#nestedcategories)

[![StyleCI](https://camo.githubusercontent.com/0c9f2e6f0fbe4367dac1145dff047a7b3615fc6c14721069d5566d892d2ac04f/68747470733a2f2f7374796c6563692e696f2f7265706f732f35303839323630362f736869656c64)](https://styleci.io/repos/50892606)[![Latest Stable Version](https://camo.githubusercontent.com/ca4983cdff2cce00b43fb880b94c8d32faa2d0a6888ed98a96ef6e1e6867dab3/68747470733a2f2f706f7365722e707567782e6f72672f64656c6174626162656c2f6e657374656463617465676f726965732f76657273696f6e2e706e67)](https://packagist.org/packages/ddpro/nestedcategories)[![Total Downloads](https://camo.githubusercontent.com/9fabc434245ecc398aa7f2df0aaf37a583febee1bae63027d6175fc310b8ee85/68747470733a2f2f706f7365722e707567782e6f72672f64656c6174626162656c2f6e657374656463617465676f726965732f642f746f74616c2e706e67)](https://packagist.org/packages/delatbabel/nestedcategories)

A Laravel 5 package for adding one or more types of category hierarchy to a website.

e.g. a hierarchy for blog categories and another for product categories

This is a Laravel 5 reimplementation of [Laravel 4 Categories](https://github.com/FbF/Laravel-Categories)

Comes with
----------

[](#comes-with)

- Migration for the `categories` table
- Category Model (that extends Baum/Node so you can use all the handy methods from this excellent nested set implementation)
- Seed for building the root nodes, one for each type of hierarchy, specified in your config file

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

[](#installation)

Add these lines to your composer.json file:

```
    "require": {
        "delatbabel/nestedcategories": "~1.0"
    },

```

Once that is done, run the composer update command:

```
    composer update

```

Alternatively just run this command:

```
    composer require delatbabel/nestedcategories

```

### Register Service Provider

[](#register-service-provider)

After composer update completes, add this line to your config/app.php file in the 'providers' array:

```
    Delatbabel\NestedCategories\NestedCategoriesServiceProvider::class

```

### Publish the Migrations

[](#publish-the-migrations)

Publish the migrations

```
    php artisan vendor:publish

```

Run the migration

```
    php artisan migrate

```

Ensure the categories `types` are set correctly in the seeder file. You can initialise this to whatever you like.

### Run the Seeders

[](#run-the-seeders)

Run the seed (this will create root nodes for each of your category `types`)

```
    php artisan db:seed --class="CategoriesTableBaseArraySeeder"

```

You may prefer to build your own **CategoriesTableSeeder** class based on the code in **CategoriesTableBaseArraySeeder** to seed your own initial set of categories.

Usage
=====

[](#usage)

This class relies on the behind-the-scenes capabilities of Baum. For details on the use of that see the [README on github](https://github.com/etrepat/baum) or the [Baum web site](http://etrepat.com/baum/)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 86% 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 ~58 days

Recently: every ~97 days

Total

8

Last Release

3344d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3bb12da0a07ef99daa73f6e75e84bc3e2e9f90a3523ab428e54deb38643876a?d=identicon)[delatbabel](/maintainers/delatbabel)

---

Top Contributors

[![delatbabel](https://avatars.githubusercontent.com/u/2335362?v=4)](https://github.com/delatbabel "delatbabel (37 commits)")[![haidangibm](https://avatars.githubusercontent.com/u/6229550?v=4)](https://github.com/haidangibm "haidangibm (6 commits)")

---

Tags

laraveleloquentl5laravel5categoriesheirarchy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/delatbabel-nestedcategories/health.svg)

```
[![Health](https://phpackages.com/badges/delatbabel-nestedcategories/health.svg)](https://phpackages.com/packages/delatbabel-nestedcategories)
```

###  Alternatives

[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[delatbabel/elocryptfive

Automatically encrypt and decrypt Eloquent attributes with ease.

8493.0k](/packages/delatbabel-elocryptfive)[dolphiq/laravel-aescrypt

AES encrypt and decrypt Eloquent attributes inspired by elocryptfive

171.7k](/packages/dolphiq-laravel-aescrypt)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)

PHPackages © 2026

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