PHPackages                             dicibi/orgs - 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. dicibi/orgs

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

dicibi/orgs
===========

Database and base models for managing corporate structures.

10PHP

Since May 11Pushed 2y ago2 watchersCompare

[ Source](https://github.com/dicibi/orgs)[ Packagist](https://packagist.org/packages/dicibi/orgs)[ RSS](/packages/dicibi-orgs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Test](https://github.com/dicibi/orgs/actions/workflows/ci.yml/badge.svg)](https://github.com/dicibi/orgs/actions/workflows/ci.yml/badge.svg)[![codecov](https://camo.githubusercontent.com/22d202f93fa410e049f52b8fdc08dcb2fe7d545807e423d36f782ada235251b4/68747470733a2f2f636f6465636f762e696f2f67682f6469636962692f6f7267732f67726170682f62616467652e7376673f746f6b656e3d6b596b48526574507530)](https://codecov.io/gh/dicibi/orgs)

The Orgs.
=========

[](#the-orgs)

This package following standard of corporate structure. It doesn't include the default structure or names, you define it yourself. This package provide only the functionalities to organize, manage, and doing business process related to job structure.

---

Main Components
---------------

[](#main-components)

The orgs. package contains 3 main organizer components.

1. Structure(s)
2. Job Title(s)
3. Office(s)

Each components have nested-set implementation.

How to Use
----------

[](#how-to-use)

Install it via `composer`.

```
composer require dicibi/orgs

```

Use via `app('orgs')`.

```
app('orgs')->structures(); // Dicibi\Orgs\Resolvers\StructureResolver
app('orgs')->offices(); // Dicibi\Orgs\Resolvers\OfficeResolver
app('orgs')->jobTitles(); // Dicibi\Orgs\Resolvers\JobTitleResolver
```

Or use `orgs` via service binding.

```
use Dicibi\Orgs\Organizer;

function (Organizer $organizer) {
    $organizer->structures(); // Dicibi\Orgs\Resolvers\StructureResolver
    $organizer->offices(); // Dicibi\Orgs\Resolvers\OfficeResolver
    $organizer->jobTitles(); // Dicibi\Orgs\Resolvers\JobTitleResolver
}
```

Define where the employment will be attached to. It's common to attach it to `users`.

```
class User extends Model {

    use HasEmployment; // add ability to this model have Job Position (historical)

}
```

### Use Case - a simple open position

[](#use-case---a-simple-open-position)

Assign user to Position.

```
// by inherit this trait
use Dicibi\Orgs\Concerns\HasEmployment;

// it's as simple as to call `assignPosition(position)` to assign a Position
auth()->user()->assignPosition($position);

// to get historically employed/assigned positions, call employments().
// @return QueryBuilder
auth()->user()->employments();

// to get current/active position (latest).
// @return Dicibi\Orgs\Models\Pivot\Position
auth()->user()->activePosition();
```

How to open new Job Position (via Office &amp; Job Title).

```
// create an Office
$newOffice = $organizer->offices()->create('Jakarta Central Office');

// create a Job title
$newTitle = $organizer->titles()->create('Vice President');

// create a position by office
$newPosition = $newOffice->openPositionFor($newTitle, quota: 1);

// or create a position by title (quota is optional)
$newPosition = $newTitle->openPositionIn($newOffice, quota: 1);

// for addition, you might get available/unavailable positions information via Office (TBA)
$newOffice->availablePositions();
$newOffice->unavailablePositions();
$newOffice->positions(); // all positions

// for addition, you might get information about Offices that open for specific Job Title
$customerServiceTitle->availableOffices();
$customerServiceTitle->offices(); // all offices
```

### Use Case - managing hierarchy between Offices

[](#use-case---managing-hierarchy-between-offices)

Manage hierarchy between central and branch offices.

```
// manage via offices resolver
/** @var \Dicibi\Orgs\Resolvers\OfficeResolver $resolver */
$resolver->attach(child: $surabayaBranch, parent: $jakartaCentralOffice);
$resolver->attach(child: $bandungBranch, parent: $jakartaCentralOffice);
$resolver->attach(child: $lampungBranch, parent: $jakartaCentralOffice);
$resolver->tree($jakartaCentralOffice); // get tree

// or manage directly via NodeTrait (kalnoy/nestedset)
/** @var \Dicibi\Orgs\Models\Office|NodeTrait $jakartaCentralOffice */
$jakartaCentralOffice->appendNode($surabayaBranch);
$jakartaCentralOffice->appendNode($bandungBranch);
$jakartaCentralOffice->appendNode($lampungBranch);
$jakartaCentralOffice->tree();
```

### Use Case - managing hierarchy between Job Titles

[](#use-case---managing-hierarchy-between-job-titles)

Manage hierarchy between job titles.

```
// manage via titles resolver
/** @var \Dicibi\Orgs\Resolvers\JobTitleResolver $resolver */
$resolver->attach(child: $presidentDirector, parent: $presidentCommissioner);
$resolver->attach(child: $financeDirector, parent: $presidentDirector);
$resolver->attach(child: $operationsDirector, parent: $presidentDirector);
$resolver->tree($presidentCommissioner);

// or manage directly via NodeTrait (kalnoy/nestedset)
/** @var \Dicibi\Orgs\Models\Pivot\Position|NodeTrait $presidentCommissioner */
$presidentCommissioner->appendNode($presidentDirector);
$presidentDirector->appendNode($financeDirector);
$presidentDirector->appendNode($operationsDirector);
$presidentCommissioner->tree();
```

### Use Case - building hierarchy with structure template

[](#use-case---building-hierarchy-with-structure-template)

Instead of managing organization structure in each office, we can manage 'template of structure' that can be assigned to the office. When we had 1 central office, and 30 branches. We do not want to define 31 offices structure each one of it every time.

By using 'structure' template, we can handle that. Let's say in 31 offices, there are office structure that called: Central Office, Branch Office, and Site.

```
/** @var \Dicibi\Orgs\Resolvers\StructureResolver $structure */
$structure->create('ID Central');
$structure->create('Branch');
$structure->create('Site');

/** @var \Dicibi\Orgs\Resolvers\JobTitleResolver $title */
$title->create('Head', structure: 'ID Central');
  $title->create('Vice-Head', structure: 'ID Central', attachTo: 'Head');
  $title->create('Division Head', structure: 'ID Central', attachTo: 'Head');
    $title->create('Group Head', structure: 'ID Central', attachTo: 'Division Head');

/** @var \Dicibi\Orgs\Resolvers\OfficeResolver $office */
$office->create('Jakarta Central Office', structure: 'ID Central');
$office->create('Aceh Branch Office', structure: 'Branch');
$office->create('Jakarta Branch Office', structure: 'Branch');
$office->create('Surabaya Site', structure: 'Site');
```

Within each structure, we can define unique Job Title structure. In Central structure, we might define Directorate, Division Head, Group Head etc. But in Branch office, that'll be no Directorate, Division or Group, but it contains Head Branch, Vice-Head Branch, Section Head, Manager etc.

It's still possible to setup cross-structure hierarchy, let's say we had Branch Structure, and Central Structure. It's possible that **Head Branch** placed as subordinate of **Division Head of Operations**.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4bca066a038d018921641b2d7134764d18f23b761b08bdbe1c9819f4d92dceed?d=identicon)[veelasky](/maintainers/veelasky)

![](https://www.gravatar.com/avatar/823b196af00eaff552c76f4fd7c636f9605c96326662ac1a8e90efc888316813?d=identicon)[muhajirinlpu](/maintainers/muhajirinlpu)

![](https://www.gravatar.com/avatar/7b9b8bc66ebb3e58073e2fc1eefc63cc206f3d2602702d2879fe07458cd16063?d=identicon)[addeeandra](/maintainers/addeeandra)

---

Top Contributors

[![addeeandra](https://avatars.githubusercontent.com/u/22489224?v=4)](https://github.com/addeeandra "addeeandra (22 commits)")

### Embed Badge

![Health badge](/badges/dicibi-orgs/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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