tenancy / multi-tenant

Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously github.com/hyn/multi-tenant

Home Page:https://tenancy.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changing Hostname of tenants

faizan-larasoft opened this issue · comments

I was changing hostname for tenants which changes perfectly save() method on Hostname Model.

The record of the hostname table changes but the tenant is not accessible by the new fqdn.

The hostname of the site comes up to be null in the following code, after record update:
$hostname = app(\Hyn\Tenancy\Environment::class)->hostname();

Please guide what way can the hostname be changed properly so that Tenancy is not affected.

I checked out the package's event listener. Turns out that the hostname gets marked at "Dirty" i.e it has been tempered/changed.

How do I mark a hostname as "Clean"? Is there a safe way to change hostname without marking it dirty? Or else alter the status to mark it clean after changing the hostname?

Turns out that after change in the hostname, we had to attach the hostname to the website again. Makes it a bit complicated, but got the solution in some time.