Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenant identification #1

Open
orderkingegypt opened this issue Oct 1, 2023 · 6 comments
Open

Tenant identification #1

orderkingegypt opened this issue Oct 1, 2023 · 6 comments
Assignees

Comments

@orderkingegypt
Copy link
Collaborator

Hello,

can you please send me your email?

And your project is missing something important.
We have many online-shops with different domains.

The tenant identification has to be done via domain.

Currently you're only identifying your tenants by email and role.

Best regards
Maciej

@Alhumsiabdo
Copy link
Owner

The assignment you requested from me is not present in the file that was sent. Do you mean that I should create a table of user domains and make it a primary key across the relationship? If this is what you mean, then I believe this assignment is unnecessary. I apologize for the delayed response. I am currently in the process of moving to a new apartment, which has caused the delay. Regarding email, it appears to be working fine. I believe the issue may be on your side

@orderkingegypt
Copy link
Collaborator Author

Hello,
the main tenant (merchant or online-shop owner) identification should be done by domain. Then when the tenant is identified by the domain a second "role" identification has to take place (admin, merchant, user)

My question to you is, how would you achieve the tenant identification by domain and how would you get the users from the tenant?

@Alhumsiabdo
Copy link
Owner

I can achieve this using an Nginx server because I can configure Nginx files to create sub domains and link them to specific database paths. Nginx allows me to set up multiple domains for the same project

@orderkingegypt
Copy link
Collaborator Author

We are using only one database. There is no need to link multiple domains to separate databases.

How would you implement multi-tenancy by domain/subdomain to load the users only from the current tenant/merchant?

@orderkingegypt
Copy link
Collaborator Author

WhatsApp Image 2023-10-23 at 17 55 15

@Alhumsiabdo
Copy link
Owner

yes i understand what do you mean now, I can make that by creating that by create table name tenats table columns id ,name, domain and also I can create a custom Middleware to handle this
and i will define route like this [Route::domain('{tenant}.yourapp.com')->group(function ($tenant) {
// Define routes for this tenant
});] and i also can male Middleware custom for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants