简体   繁体   English

在 Laravel 中实现多租户

[英]Implementing Multi-tenancy in Laravel

I am using Laravel 5.4 with having Laravel Voyager Installed.我正在使用 Laravel 5.4 并安装了 Laravel Voyager。

The main requirements of the project are to have the multi-tenant domain based application ie app.com and {client}.app.com该项目的主要要求是拥有基于多租户域的应用程序,即 app.com 和 {client}.app.com

I have been trying to load configurations based on a subdomain and will act subdomain as the client code which worked fine on localhost but while I am pushing changes to live server things are not working我一直在尝试基于子域加载配置,并将子域作为在本地主机上运行良好的客户端代码,但是当我将更改推送到实时服务器时,事情却不起作用

As a beginner in this scope, I am not sure how thing will work on the live environment, in terms of domain redirection and setting up options in middleware, or mainly how wildcard subdomain would work in laravel's subdomain routing作为这个范围的初学者,我不确定在实时环境中如何工作,在域重定向和中间件中设置选项方面,或者主要是通配符子域如何在 laravel 的子域路由中工作

You can use this package: https://github.com/hyn/multi-tenant你可以使用这个包: https : //github.com/hyn/multi-tenant

I've used this many times and can confirm it works extremely well.我已经多次使用它并且可以确认它非常有效。 As an added bonus, there's a very detailed tutorial you can use to get going here:https://laravel-tenancy.com/docs/hyn/5.x/full-featured-tutorial作为额外的奖励,您可以使用非常详细的教程来这里:https ://laravel-tenancy.com/docs/hyn/5.x/full-featured-tutorial

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

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