mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 20:54:04 +00:00
Merge branch '2.x' of github.com:stancl/tenancy into 2.x
This commit is contained in:
commit
cbaa775876
1 changed files with 2 additions and 2 deletions
|
|
@ -109,14 +109,14 @@ class RedisStorageDriver implements StorageDriver
|
|||
|
||||
$this->redis->transaction(function ($pipe) use ($data, $domains) {
|
||||
$id = $data['id'];
|
||||
|
||||
|
||||
$old_domains = json_decode($pipe->hget("tenants:$id", 'domains'), true);
|
||||
$deleted_domains = array_diff($old_domains, $domains);
|
||||
|
||||
foreach ($deleted_domains as $deleted_domain) {
|
||||
$pipe->del("domains:$deleted_domain");
|
||||
}
|
||||
|
||||
|
||||
$pipe->hmset("tenants:$id", array_merge($data, ['_tenancy_domains' => json_encode($domains)]));
|
||||
foreach ($domains as $domain) {
|
||||
$pipe->hmset("domains:$domain", 'tenant_id', $id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue