PHPackages                             cleaniquecoders/laravel-organization - 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. cleaniquecoders/laravel-organization

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

cleaniquecoders/laravel-organization
====================================

Provide organization related app

1.4.0(4mo ago)72.3k2[1 PRs](https://github.com/cleaniquecoders/laravel-organization/pulls)MITPHPPHP ^8.4CI passing

Since Oct 10Pushed 1mo agoCompare

[ Source](https://github.com/cleaniquecoders/laravel-organization)[ Packagist](https://packagist.org/packages/cleaniquecoders/laravel-organization)[ Docs](https://github.com/cleaniquecoders/laravel-organization)[ GitHub Sponsors]()[ RSS](/packages/cleaniquecoders-laravel-organization/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (30)Versions (17)Used By (0)

Laravel Organization
====================

[](#laravel-organization)

[![Latest Version on Packagist](https://camo.githubusercontent.com/01707caf122b97d970752479cb3993d1b6eee29b3ff1434d0d08d4a1ca4ca0b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c65616e69717565636f646572732f6c61726176656c2d6f7267616e697a6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/laravel-organization)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a334bbf32c16608f3c5ff0ef9fd0074d02e389380787a639a0c13b12123e66b2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c65616e69717565636f646572732f6c61726176656c2d6f7267616e697a6174696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cleaniquecoders/laravel-organization/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e1d8d58a06b1f6f86a82d90fc7a053f57f42f81544c918d9b8d616df436b4a9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c65616e69717565636f646572732f6c61726176656c2d6f7267616e697a6174696f6e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/cleaniquecoders/laravel-organization/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/fff3f95efa4bcb933d5a34b5a1518b1f674d9c66567bd08870907f79076e4381/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c65616e69717565636f646572732f6c61726176656c2d6f7267616e697a6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/laravel-organization)[![Code Coverage](https://camo.githubusercontent.com/038cd168d2943c4b33735e065bdeb278befa0218aec6a203f18666b281f3155f/68747470733a2f2f636f6465636f762e696f2f67682f636c65616e69717565636f646572732f6c61726176656c2d6f7267616e697a6174696f6e2f6272616e63682f6d61696e2f67726170682f62616467652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/cleaniquecoders/laravel-organization)

A comprehensive Laravel package for implementing organization-based tenancy in your application. This package provides a complete solution for managing organizations, user memberships, roles, and automatic data scoping with SOLID principles compliance.

Key Features
------------

[](#key-features)

- **🏢 Organization Management** - Complete CRUD operations with UUID and slug support
- **👥 User Membership** - Flexible role-based membership system with administrators and members
- **🔒 Automatic Data Scoping** - Seamless multi-tenancy through Eloquent global scopes
- **⚙️ Comprehensive Settings** - Extensive JSON-based configuration system with validation
- **🧩 SOLID Principles** - Contract-based architecture for flexibility and testability
- **🛠️ Developer Friendly** - Built-in factories, commands, and trait-based integration

Screenshots
-----------

[](#screenshots)

### Organization Management

[](#organization-management)

[![Organization Dashboard](screenshots/organization.png)](screenshots/organization.png)

### Organization Switcher

[](#organization-switcher)

[![Organization Switcher](screenshots/organization-switcher.png)](screenshots/organization-switcher.png)

### Create New Organization

[](#create-new-organization)

[![Create New Organization](screenshots/create-new-organization.png)](screenshots/create-new-organization.png)

Quick Start
-----------

[](#quick-start)

### Installation

[](#installation)

```
# Install the package
composer require cleaniquecoders/laravel-organization

# Publish and run migrations
php artisan vendor:publish --tag="org-migrations"
php artisan migrate

# (Optional) Publish configuration file
php artisan vendor:publish --tag="org-config"

# (Optional) Publish views for customization
php artisan vendor:publish --tag="org-views"
```

> **Note:** The migration will create `organizations`, `organization_users` tables and add an `organization_id` column to your `users` table.

### Basic Usage

[](#basic-usage)

```
use CleaniqueCoders\LaravelOrganization\Actions\CreateNewOrganization;
use CleaniqueCoders\LaravelOrganization\Enums\OrganizationRole;

// Create an organization
$organization = (new CreateNewOrganization())->handle($user);

// Add members
$organization->addUser($user, OrganizationRole::ADMINISTRATOR);
$organization->addUser($member, OrganizationRole::MEMBER);

// Configure settings
$organization->setSetting('app.timezone', 'America/New_York');
$organization->setSetting('features.api_access', true);
$organization->save();
```

### Add to Your User Model

[](#add-to-your-user-model)

```
use CleaniqueCoders\LaravelOrganization\Concerns\InteractsWithUserOrganization;
use CleaniqueCoders\LaravelOrganization\Contracts\UserOrganizationContract;

class User extends Authenticatable implements UserOrganizationContract
{
    use InteractsWithUserOrganization;

    protected $fillable = ['name', 'email', 'password', 'organization_id'];
}

// Now you can:
$user->organizations;              // Get all user's organizations
$user->currentOrganization;        // Get current organization
$user->ownedOrganizations;         // Get organizations user owns
$user->belongsToOrganization($id); // Check membership
$user->isAdministratorOf($id);     // Check admin role
```

Documentation
-------------

[](#documentation)

Comprehensive documentation is available in the `docs/` directory:

- **[📖 Installation Guide](docs/02-development/01-installation.md)** - Detailed setup instructions
- **[🚀 Usage Guide](docs/02-development/02-configuration.md)** - Complete usage examples and patterns
- **[⚙️ Configuration](docs/02-development/02-configuration.md)** - All configuration options and customization
- **[🎯 Features Overview](docs/01-architecture/01-overview.md)** - Complete feature breakdown
- **[🔧 Contracts Documentation](docs/01-architecture/02-contracts.md)** - SOLID principles and custom implementations
- **[🧩 Components &amp; Actions](docs/03-usage/03-components-and-actions.md)** - Livewire components and action classes

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

[](#requirements)

- PHP 8.4+
- Laravel 11.0+ or 12.0+

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Credits
-------

[](#credits)

- [Nasrul Hazim Bin Mohamad](https://github.com/nasrulhazim)
- [All Contributors](../../contributors)

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance83

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90.6% 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 ~14 days

Recently: every ~22 days

Total

13

Last Release

133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b57069d0f4b634f65eccc6e5d5848990e25968d45ec2cf46d626c6a4658f944b?d=identicon)[nasrulhazim.m](/maintainers/nasrulhazim.m)

---

Top Contributors

[![nasrulhazim](https://avatars.githubusercontent.com/u/10341422?v=4)](https://github.com/nasrulhazim "nasrulhazim (87 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![ahmadsyamim](https://avatars.githubusercontent.com/u/14102774?v=4)](https://github.com/ahmadsyamim "ahmadsyamim (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelCleanique Coderslaravel-organization

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cleaniquecoders-laravel-organization/health.svg)

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

###  Alternatives

[leandrocfe/filament-apex-charts

Apex Charts integration for Filament PHP.

4971.7M12](/packages/leandrocfe-filament-apex-charts)[filament/support

Core helper methods and foundation code for all Filament packages.

2333.9M295](/packages/filament-support)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329575.9k33](/packages/codewithdennis-filament-select-tree)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.8k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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