1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 20:34:03 +00:00

Fix Travis, add docs for generating HTTPS certificates (#19)

This commit is contained in:
Samuel Štancl 2019-02-07 15:26:42 +01:00 committed by GitHub
parent 0adbfee86e
commit 6bb18a2b95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 108 additions and 7 deletions

View file

@ -2,9 +2,9 @@
namespace Stancl\Tenancy;
use Stancl\Tenancy\BootstrapsTenancy;
use Illuminate\Support\Facades\Redis;
use Stancl\Tenancy\Interfaces\StorageDriver;
use Stancl\Tenancy\Traits\BootstrapsTenancy;
class TenantManager
{
@ -77,7 +77,7 @@ class TenantManager
throw new \Exception("Domain $domain is already occupied by tenant $id.");
}
$tenant = $this->storage->createTenant($domain, \Uuid::generate(1, $domain));
$tenant = $this->storage->createTenant($domain, \Webpatser\Uuid\Uuid::generate(1, $domain));
$this->database->create($this->getDatabaseName($tenant));
return $tenant;
@ -264,4 +264,19 @@ class TenantManager
return $this->put($this->put($key, $value));
}
/**
* Return the identified tenant's attribute(s).
*
* @param string $attribute
* @return mixed
*/
public function __invoke($attribute)
{
if (is_null($attribute)) {
return $this->tenant;
}
return $this->tenant[(string) $attribute];
}
}