简体   繁体   English

多租户和多个域Laravel-5

[英]Multi tenancy and multiple domains Laravel-5

I'm building an SaaS application in Laravel-5. 我正在Laravel-5中构建一个SaaS应用程序。 Basically, I want our client to be able to point their domain to our name servers and effectively the application will load their website template (which will vary from client to client). 基本上,我希望我们的客户能够将他们的域指向我们的名称服务器,并且有效地应用程序将加载他们的网站模板(这将随客户端而变化)。 It will also allow our clients' members to login to their account through their website and load all of their personal details. 它还允许我们的客户成员通过他们的网站登录他们的帐户并加载他们的所有个人详细信息。

Is this possible in Laravel-5 and can anyone point me in the right direction? 在Laravel-5中这可能吗?任何人都可以指出我正确的方向吗?

There are several ways to support multi tenancy in laravel. 有几种方法可以支持laravel中的多租户。

  • Using middleware you can dynamically mutate the request object to modify behavior of the application. 使用中间件,您可以动态地改变请求对象以修改应用程序的行为。
  • By modifying the path locations you can then change where views and almost anything else is loaded from. 通过修改路径位置,您可以更改视图和几乎所有其他内容的加载位置。
  • Landlord , a single database multi-tenancy package for Laravel & Lumen 5.2+. Landlord ,Laravel&Lumen 5.2+的单一数据库多租户套餐。
  • Another proven package is Tenanti which handles custom database connections and even observes models to track changes to different database connections. 另一个经过验证的包是Tenanti ,它处理自定义数据库连接,甚至可以观察模型来跟踪对不同数据库连接的更改。
  • I'm currently maintaining a multi tenancy package for Laravel that allows complete division of responsibility for databases, files etc while maintaining a system connection for system wide settings and hostname setup. 我目前正在为Laravel 维护一个多租户包,允许对数据库,文件等进行完全分工,同时保持系统连接以进行系统范围的设置和主机名设置。

Deprecated: 推荐使用:

  • If you only want to have one database that stores all tenants, you might be interested in AuraEQ , I'm not sure there should be others. 如果您只想拥有一个存储所有租户的数据库,您可能对AuraEQ感兴趣,我不确定应该有其他人。 Is now Landlord. 现在是房东。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM