PHPackages                             fredlabs/business-units - 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. fredlabs/business-units

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

fredlabs/business-units
=======================

Business units handler for Laravel 10.\* and above.

v1.0.1(1y ago)05MITPHPPHP &gt;=8.2

Since Aug 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nisithaD/FredLabs-BusinessUnit)[ Packagist](https://packagist.org/packages/fredlabs/business-units)[ RSS](/packages/fredlabs-business-units/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

[![MIT License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://choosealicense.com/licenses/mit/)

FredLabs Business Units
=======================

[](#fredlabs-business-units)

#### Handle business unit within your application.

[](#handle-business-unit-within-your-application)

`fredlabs/business-units` is a Laravel package for handling business units in your application. It provides a trait and model for managing business units and includes functionality for automatically updating existing tables with a `business_unit_id` column.

Requirements
------------

[](#requirements)

- Laravel 10.x or higher
- PHP 8.2 or higher
- Composer

Installation, and Usage Instructions
------------------------------------

[](#installation-and-usage-instructions)

To install the package, use Composer:

```
composer require fredlabs/business-units
```

Publish Vendor Files
--------------------

[](#publish-vendor-files)

After successful installation, publish the package's configuration and migration files by running:

```
php artisan vendor:publish --provider="FredLabs\BusinessUnits\Providers\BusinessUnitServiceProvider"
```

Edit Configuration
------------------

[](#edit-configuration)

The above command will publish customizable configuration files. In the config/business-units.php file, you can add or modify the fillable attributes in the business\_units array to specify which fields you want to use for business unit parameters. For example:

```
return [
    'fillable' => [
        'name',
        'description',
        'other_field',
    ],
];
```

Migrate Tables
--------------

[](#migrate-tables)

To apply the changes to your existing tables, including adding the business\_unit\_id column, run:

```
php artisan migrate
```

Usage
-----

[](#usage)

After installation and migration, you can use the HasBusinessUnit trait in your Eloquent models to enable business unit functionality. Here's how to use it in your models:

```
use FredLabs\BusinessUnits\Traits\HasBusinessUnit;

class User extends Authenticatable
{
    use HasBusinessUnit;
}
```

This trait will allow you to associate business units with your models. Ensure to adjust your models and controllers to handle business unit logic as required.

Authors and Acknowledgments
---------------------------

[](#authors-and-acknowledgments)

- FredLabs: Development and maintenance of the package.
- Special thanks to the Laravel community and contributors who provide support and feedback.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

678d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64686343?v=4)[Fred on GitHub](/maintainers/FredLabs)[@FredLabs](https://github.com/FredLabs)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/fredlabs-business-units/health.svg)

```
[![Health](https://phpackages.com/badges/fredlabs-business-units/health.svg)](https://phpackages.com/packages/fredlabs-business-units)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6804.7k6](/packages/hasinhayder-tyro)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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