# spatie/laravel-multitenancy

Make your Laravel app usable by multiple tenants

Repository: https://github.com/spatie/laravel-multitenancy
Canonical: https://ross.abutalabs.com/products/laravel-multitenancy
Homepage: https://spatie.be/docs/laravel-multitenancy
Language: PHP
License: MIT
License Family: permissive
Topics: laravel, php, multitenancy
Last push: 2026-08-07T12:48:07+00:00

## Health v2 (maintenance only)
Score: 93/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 84, longevity 100
- inputs: {"age_days": 2317, "days_push": 26, "days_rel": 26, "gap_med": 55, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1364, forks 182 (observed 2026-08-28T04:04:30.573868+00:00)

## What it is
An unopinionated Laravel package that makes a Laravel application tenant-aware, supporting single- or multi-database multitenancy. It handles tenant resolution per request, tenant switching tasks, tenant-aware queued jobs, and per-tenant artisan commands.

## Use cases
- add multitenancy to a Laravel SaaS app
- serve multiple customers from one Laravel codebase
- run artisan commands for every tenant
- make queued jobs tenant aware
- switch database connections per tenant
- resolve the current tenant from the request

## When to choose
- you want a minimal, unopinionated multitenancy foundation you can customize
- your Laravel app needs single-database or multi-database tenancy
- you want tenant-aware queues and artisan commands out of the box

## When to avoid
- you want a batteries-included SaaS boilerplate with billing and auth
- you are not using Laravel or PHP
- you need fully automatic row-level tenant scoping with no configuration

## Facets
- artifact type: library
- maturity: stable
- function: middleware, database, orm, configuration-management
- domain: web-development, backend, developer-tools
- platform: php, self-hosted
- tags: laravel, multitenancy, saas, tenant-isolation, eloquent, spatie, web-server

## Member repositories
- spatie/laravel-multitenancy (main) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:30.573868+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:41:22.546009+00:00, confidence not recorded.
  - readme: https://github.com/spatie/laravel-multitenancy (fetched 2026-08-28T04:04:30.573868+00:00, sha abc86e617f00)
  - homepage: https://spatie.be/docs/laravel-multitenancy (fetched 2026-08-29T11:58:58.194751+00:00, sha cf3695f419a4)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T11:58:58.203849+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T11:58:58.206008+00:00, sha d3cb88e4b34c)
  - site_page: https://spatie.be/docs/laravel-multitenancy/v4 (fetched 2026-08-29T11:58:58.207703+00:00, sha a4f9abec24cb)
  - site_page: https://spatie.be/docs/laravel-multitenancy/v3 (fetched 2026-08-29T11:58:58.209293+00:00, sha 03e370cd8dc7)
  - site_page: https://spatie.be/docs/laravel-multitenancy/v2 (fetched 2026-08-29T11:58:58.210897+00:00, sha 5e56b6951bd3)
  - site_page: https://spatie.be/docs/laravel-multitenancy/v1 (fetched 2026-08-29T11:58:58.212575+00:00, sha 8c868b5d983d)
  - site_page: https://spatie.be/docs/laravel-multitenancy/v4/upgrade-guide (fetched 2026-08-29T11:58:58.214243+00:00, sha c7f561afcde7)
  - site_page: https://spatie.be/docs/laravel-multitenancy/v4/support-us (fetched 2026-08-29T11:58:58.215867+00:00, sha 873f8491b629)
- Data as of 2026-08-30T08:39:29.467469+00:00.
