PHPackages                             rocketslab/laravel-multitenancy-extensions - 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. rocketslab/laravel-multitenancy-extensions

ActiveProject[Framework](/categories/framework)

rocketslab/laravel-multitenancy-extensions
==========================================

Spatie Laravel Multitenancy Extensions Package

0.3(4y ago)122MITPHPPHP ^7.4|^8.0

Since Jun 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/RocketsLab/laravel-multitenancy-extensions)[ Packagist](https://packagist.org/packages/rocketslab/laravel-multitenancy-extensions)[ RSS](/packages/rocketslab-laravel-multitenancy-extensions/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

Multitenancy Extensions
=======================

[](#multitenancy-extensions)

---

[Versão em português (Brasil)](README_pt-BR.md)

This package are created for use with [Spatie's Laravel Multitenancy](https://spatie.be/docs/laravel-multitenancy/v1/introduction).

### Installation

[](#installation)

```
composer require rocketslab/laravel-multitenancy-extensions
```

### Configuration

[](#configuration)

Publish default configuration.

```
php artisan vendor:publish --provider="RocketsLab\MultitenancyExtensions\MultitenancyExtensionsServiceProvider" --tag="config"
```

### Activating the default database to current Tenant

[](#activating-the-default-database-to-current-tenant)

By default, the **multitenancy** package has a task to do the database switching on each request. But by doing this in background (when creating a new Tenant), the `default` database is not assigned. And so when trying to migrate the tables and populate the database with initial data the new database is not found by Laravel.

To solve this add the `ActiveDefaultDatabase` task to the task array in `multitenancy` config file as first from the list.

```
    //...
    'switch_tenant_tasks' => [
        \RocketsLab\MultitenancyExtensions\Tasks\ActivateDeafultDatabase::class,
        \Spatie\Multitenancy\Tasks\SwitchTenantDatabaseTask::class,
        // ... other tasks
    ],
    //...
```

### Creating Tenants Databases

[](#creating-tenants-databases)

After configuring the `spatie/laravel-tenancy` Tenant model. You can activate automatic database creation. To do this, include the `ShoudCreateDatabase` trait to Tenant model.

### Landlord Database Migration Helper

[](#landlord-database-migration-helper)

This package comes with a command to help migrate to landlord database.

```
php artisan landlord:migrate
```

This command run all migrations in the `database/migrations/landlord` folder by default. If you can modify this, edit `landlord` configuration section in `multitenancy-extensions`configuration file.

Optionally you can use `--fresh` flag to drop all tables and migrate.

---

Created by [@jjsquady - Jorge Gonçalves](https://github.com/jjsquady)

Thanks to [Spatie](https://spatie.be) team.

License MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Every ~2 days

Total

5

Last Release

1795d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eaa735041f66903d9a2873f2e524f9133eae6961f9b9d068510591ba20095dd5?d=identicon)[jjsquady](/maintainers/jjsquady)

---

Top Contributors

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

---

Tags

spatielaravel-multitenancyrocketslabmultitenancy-extensions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rocketslab-laravel-multitenancy-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/rocketslab-laravel-multitenancy-extensions/health.svg)](https://phpackages.com/packages/rocketslab-laravel-multitenancy-extensions)
```

###  Alternatives

[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13753.8k](/packages/spatie-pest-plugin-route-testing)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)[ecotone/laravel

Laravel integration for Ecotone

21307.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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