I’m just starting out with Laravel and I’ve got a situation where I need to create a new database for every new registration. After the database is set up, I want to run all the existing migrations to create the necessary tables in that new database. When a user logs in, Laravel needs to link up with the appropriate database only. Any suggestions on how to make this happen?
Explanation/SRS: I’m working on a system that allows various companies to sign up, and I need to generate a unique ID for each one. After they register, each company will have several users. I plan to create a separate database for each company to keep their data separate. Later on, each company will have multiple users, and when a user logs in using their company ID, Laravel will link to the right company database and authenticate the user.
I haven’t attempted anything since I’m still figuring things out.
Amit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
15