DigitalWheat / Multi-Domain-Laravel

An example of multi-domain/subdomain app in Laravel.
220 stars 96 forks source link

[Question] How to assign sub domain to different table? #1

Closed krisnaw closed 5 years ago

krisnaw commented 5 years ago

Hi there,

Quick question. I'm curious how do you make route listen to 'domain' column on shops tables? Is that mean 1 user can have multiple shops with multiple subdomain?

Thanks, looking forward.

maxkostinevich commented 5 years ago

Hi,

Yes, each user can own several stores. For more information, please see:

  1. routes/web.php (Line 49+)
  2. app/Shop.php Model
  3. app/Http/Middleware/CheckShopDomain.php which checks the subdomain
  4. app/Http/helpers.php for helper functions
krisnaw commented 5 years ago

Hi @maxkostinevich, Thanks for the responses. The issue was I forgot to add wildcard on the DNS. But now is sorted. 1 user can have multiple subdomains.