PHPackages                             intelfric/multi-tenant-role - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. intelfric/multi-tenant-role

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

intelfric/multi-tenant-role
===========================

Multi-tenant role and permission management for Laravel SaaS applications

4.3.1(9mo ago)012MITPHPPHP ^8.1

Since Jul 17Pushed 9mo agoCompare

[ Source](https://github.com/INTELFRIC/Multi_Tenant_Role_Package)[ Packagist](https://packagist.org/packages/intelfric/multi-tenant-role)[ RSS](/packages/intelfric-multi-tenant-role/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (9)Used By (0)

Laravel Multi-Tenant Role Package
=================================

[](#laravel-multi-tenant-role-package)

A Laravel package for multi-tenant role and permission management, perfect for SaaS applications where users can belong to multiple tenants with different roles in each.

Features
--------

[](#features)

- 🏢 **Multi-tenant architecture** - Users can belong to multiple tenants
- 🎭 **Tenant-scoped roles** - Different roles per tenant for the same user
- 🔐 **Permission management** - Fine-grained permissions within each tenant
- 🛡️ **Middleware protection** - Route-level tenant permission/role checking
- 🎨 **Blade directives** - Template-level authorization checks
- ⚡ **Easy installation** - One command setup
- 🔧 **Configurable** - Customizable table names and user models
- ⚛️ **Inertia.js + React support** - Modern frontend integration

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

[](#installation)

### 1. Install the package via Composer:

[](#1-install-the-package-via-composer)

```
composer require intelfric/multi-tenant-role
```

### 2. Publish and run the migrations:

[](#2-publish-and-run-the-migrations)

```
php artisan vendor:publish --provider="Intelfric\MultiTenantRole\MultiTenantRoleServiceProvider" --tag="multi-tenant-role-migrations"
php artisan migrate
```

### 3. Add the `HasTenantRoles` trait to your User model:

[](#3-add-the-hastenantroles-trait-to-your-user-model)

```
