PHPackages                             mymediamagnet/multi-tenant-laravel - 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. [Framework](/categories/framework)
4. /
5. mymediamagnet/multi-tenant-laravel

ActiveLibrary[Framework](/categories/framework)

mymediamagnet/multi-tenant-laravel
==================================

Laravel Multi Tenant Package

04PHP

Since Jul 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MyMediaMagnet/multi-tenant-laravel)[ Packagist](https://packagist.org/packages/mymediamagnet/multi-tenant-laravel)[ RSS](/packages/mymediamagnet-multi-tenant-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (3)Used By (0)

Very short description of the package
=====================================

[](#very-short-description-of-the-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/983b4dbf4e371759701bf66bdc8cfb711ef22d3d880463219dff909a5cc9986a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f3a7061636b6167655f6e616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/:package_name)[![Build Status](https://camo.githubusercontent.com/689b560fe1e294e9c079a09198194f927a455501da3ca4b4e4ecb0283fe64eb6/68747470733a2f2f7472617669732d63692e6f72672f4d794d656469614d61676e65742f6d756c74692d74656e616e742d6c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/MyMediaMagnet/multi-tenant-laravel)[![Quality Score](https://camo.githubusercontent.com/cce5ff34ff595ab075d4ec810e5f33bbba41e8c92e0ab88950c21809ef635a0f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4d794d656469614d61676e65742f6d756c74692d74656e616e742d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/MyMediaMagnet/multi-tenant-laravel)[![Coverage Status](https://camo.githubusercontent.com/11ad484bc86e1362c2e398b469d2edf5f4b8cfee2bea0164449b3a65f50431cd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d794d656469614d61676e65742f6d756c74692d74656e616e742d6c61726176656c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/MyMediaMagnet/multi-tenant-laravel?branch=master)[![Total Downloads](https://camo.githubusercontent.com/af5232af0f74cf6975c0d28ebe76eb16891ded691563caae2454803632ca4d6e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f3a7061636b6167655f6e616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/:package_name)

This package is intended to be a flexible starting point for new multi-tenant projects in Laravel. Still a WIP

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

[](#installation)

You can install the package via composer:

```
composer require mymediamagnet/multi-tenant-laravel
```

Setup
-----

[](#setup)

- Make sure all Auth routes are removed from your routes to start off
- Run `php artisan vendor:publish` and selecting multi-tenant-laravel as the package
- Run `php artisan migrate`. This will create all the tables required in this package
- In the file `app\Http\Middleware\RedirectIfAuthenticated` you might see `return redirect('/home');`. Change this to `return redirect('/');`.

Setting Up Your Models
----------------------

[](#setting-up-your-models)

Create the following models for the primary tables in the packages migrations. Make sure to extend the base classes from the package

- Role
- Permission
- Tenant
- Feature
- User (likely already created)

```
use MultiTenantLaravel\App\Models\BaseUser;

class User extends BaseUser
{
    ...
}
```

```
use MultiTenantLaravel\App\Models\BaseTenant;

class Tenant extends BaseTenant
{
    ...
}
```

Follow the same pattern in making your Role, Permission &amp; Feature models

Usage
-----

[](#usage)

By default your project should now be setup to automatically redirect you to the login page on visit. To create a new user, you can use the helper command.

`php artisan tenant:create-user` - you will be asked a series of questions to setup your new user, or you can quickly create a fake user using `php artisan tenant:create-user --fake`

To create a new tenant:

`php artisan tenant:create-tenant` - you will be asked a series of questions to setup your new tenant, or you can quickly create a fake tenant using `php artisan tenant:create-tenant --fake`

When creating a new tenant, you will be provided the option to add an existing user to the tenant, or create a new user.

Once you login, if your user is only a member of 1 tenant you will be immediatly redirected to that tenants dashboard. Otherwise, you'll land on a dashboard that allows you to select which dashboard you would like to manage

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

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

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [:author\_name](https://github.com/:author_username)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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/92a303d3fa2517fc0ec5cf790760659e39ab718cb3e1dcf042aea9e09dada0df?d=identicon)[DeveloperPlus](/maintainers/DeveloperPlus)

---

Top Contributors

[![MyMediaMagnet](https://avatars.githubusercontent.com/u/957497?v=4)](https://github.com/MyMediaMagnet "MyMediaMagnet (18 commits)")[![brandonp13](https://avatars.githubusercontent.com/u/16212672?v=4)](https://github.com/brandonp13 "brandonp13 (9 commits)")[![BrandonSPT](https://avatars.githubusercontent.com/u/17050174?v=4)](https://github.com/BrandonSPT "BrandonSPT (3 commits)")

### Embed Badge

![Health badge](/badges/mymediamagnet-multi-tenant-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/mymediamagnet-multi-tenant-laravel/health.svg)](https://phpackages.com/packages/mymediamagnet-multi-tenant-laravel)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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