Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi tenancy and multiple domains Laravel-5

I'm building an SaaS application in Laravel-5. 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?

like image 694
V4n1ll4 Avatar asked Feb 10 '23 13:02

V4n1ll4


1 Answers

There are several ways to support multi tenancy in 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+.
  • Another proven package is Tenanti which handles custom database connections and even observes models to track changes to different database connections.
  • 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.

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. Is now Landlord.
like image 69
Luceos Avatar answered Feb 12 '23 02:02

Luceos