Hello can you please help me to put project laravel Multi-tenant with Multi-database :
I want to create user database, for example in my system there are two user A and B. I have a master Database and two database user_a (for user A) and user_b (for user B). In master Database i have the all users information. Now what i want, when user A logged in system it access user_a database, and when user B logged in database connection should be user_b database.
.env
:config/database.php
:Model
orDB
you can do: For models:For database queries:
Note: don't forget to run
php artisan config:cache
when changing.env
file orconfig/database.php