1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 19:04:02 +00:00

Merge branch '1.x' of github.com:stancl/tenancy into 1.x

This commit is contained in:
Samuel Štancl 2019-08-17 14:41:38 +02:00
commit 08148225eb
2 changed files with 3 additions and 4 deletions

View file

@ -19,7 +19,7 @@ class CreateTenantsTable extends Migration
// your indexed columns go here
$table->json('data')->default('{}');
$table->json('data');
});
}

View file

@ -86,11 +86,10 @@ class RedisStorageDriver implements StorageDriver
if (config('database.redis.client') === 'phpredis') {
$redis_prefix = $this->redis->getOption($this->redis->client()::OPT_PREFIX) ?? $redis_prefix;
$all_keys = $this->redis->scan(null, $redis_prefix . 'tenants:*');
} else {
$all_keys = $this->redis->scan(null, 'MATCH', $redis_prefix . 'tenants:*')[1];
}
$all_keys = $this->redis->keys('tenants:*');
$hashes = \array_map(function ($key) use ($redis_prefix) {
// Left strip $redis_prefix from $key
return \substr($key, \strlen($redis_prefix));