mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 02:54:05 +00:00
Events
This commit is contained in:
parent
87916bd8e5
commit
d3712dfacc
3 changed files with 63 additions and 8 deletions
|
|
@ -5,13 +5,14 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy;
|
||||
|
||||
use ArrayAccess;
|
||||
use Stancl\Tenancy\Contracts\Tenant as CurrentTenant;
|
||||
|
||||
// todo tenant storage
|
||||
|
||||
/**
|
||||
* @internal Class is subject to breaking changes in minor and patch versions.
|
||||
*/
|
||||
class Tenant implements ArrayAccess, Contracts\Tenant
|
||||
class Tenant implements ArrayAccess, CurrentTenant
|
||||
{
|
||||
use Traits\HasArrayAccess;
|
||||
|
||||
|
|
@ -48,7 +49,9 @@ class Tenant implements ArrayAccess, Contracts\Tenant
|
|||
|
||||
public static function new(): self
|
||||
{
|
||||
return app(static::class);
|
||||
return app(static::class)->withData([
|
||||
'id' => static::generateId(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function fromStorage(array $data): self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue