0

I am looking towards building a multi-tenant Laravel app which is a school management system that has one code-base but has multiple databases for each school. This system will have 800 schools (tenants), and each school will have its own users (teachers and students).

How can I implement the above with Laravel? Can or should I use a package or the is laravel native implementation of the above?

Every time a school is registered, how can I automatically create a subdomain on a domain, and automatically load the new tenant on AWS EBS or Heroku

How can I run one migration to all multiple databases ?

Lusit
  • 21
  • 4
  • Hello, and welcome to Stack Overflow. This is a very open-ended question, and is not a great fit for this community. Perhaps if you refined/narrowed down your question, we could help. – Neville Kuyt Aug 20 '21 at 13:18
  • Hello, and also welcome to Stack Overflow. This platform is designed to help you solve code issues and not to advise you on how to deal with application design. For that reason I will ask that this question be closed. – Azeame Aug 20 '21 at 17:21

1 Answers1

0

yes, you can do it by declaring multiple database connections in your config file and the set connection dynamically in each fetch queries and also migration queries.

in normal queries:

DB::connection('some dynamic connection name')->...

or in migrations:

Schema::connection('connection name')->....