承接 spatie/laravel-multitenancy 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spatie/laravel-multitenancy

最新稳定版本:4.0.7

Composer 安装命令:

composer require spatie/laravel-multitenancy

包简介

Make your Laravel app usable by multiple tenants

README 文档

README

Logo for laravel-multitenancy

Unopinionated multitenancy package for Laravel

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package can make a Laravel app tenant aware. The philosophy of this package is that it should only provide the bare essentials to enable multitenancy.

The package can determine which tenant should be the current tenant for the request. It also allows you to define what should happen when switching the current tenant to another one. It works for multitenancy projects that need to use one or multiple databases.

Before starting with the package, we highly recommend first watching this talk by Tom Schlick on multitenancy strategies.

The package contains a lot of niceties such as making queued jobs tenant aware, making an artisan command run for each tenant, an easy way to set a connection on a model, and much more.

Are you a visual learner? Then watch this video that covers how you can use laravel-multitenancy and how it works under the hood.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Documentation

You can find the entire documentation for this package on our documentation site.

Testing

You'll need to create the following 3 local MySql databases to be able to run the test suite:

  • laravel_mt_landlord
  • laravel_mt_tenant_1
  • laravel_mt_tenant_2

You can run the package's tests:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.

Credits

The code of this package is based on the code shown in the Multitenancy in Laravel series by Mohamed Said

Alternatives

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 2.51M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1291
  • 点击次数: 1
  • 依赖项目数: 16
  • 推荐数: 0

GitHub 信息

  • Stars: 1289
  • Watchers: 27
  • Forks: 178
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04