How can I handle subdomains with one laravel installation

前端 未结 7 2040
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 09:19

I am creating a laravel project for which I need one laravel installation and use its instance in sub-domain with separate database. And th

7条回答
  •  灰色年华
    2020-12-29 10:09

    Multi-tenancy is a tricky architecture that needs care to model. There are several ways to achieve this architecture. Some decide to use a single database whiles others prefer to use multiple database(that is in your case).

    They both have their pros and cons that you need to consider. There are a lot of factors that need to be taken into consideration before you start modeling your application. eg Virtual host configuration for subdomains, Database migration(rollback all databases when the need be, etc.). I will suggest these two packages that can help you going and give you more insight on how to model your application to suite what you want.

    https://github.com/orchestral/tenanti

    https://github.com/hyn/multi-tenant

提交回复
热议问题