mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:14:04 +00:00
Use a nicer way to bind the current tenant
This commit is contained in:
parent
27425a4360
commit
6b716e5345
6 changed files with 62 additions and 38 deletions
|
|
@ -5,14 +5,14 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy;
|
||||
|
||||
use ArrayAccess;
|
||||
use Stancl\Tenancy\Contracts\Tenant as CurrentTenant;
|
||||
|
||||
// todo tenant storage
|
||||
// todo create tenant - create db?
|
||||
|
||||
/**
|
||||
* @internal Class is subject to breaking changes in minor and patch versions.
|
||||
*/
|
||||
class Tenant implements ArrayAccess, CurrentTenant
|
||||
class Tenant implements ArrayAccess
|
||||
{
|
||||
use Traits\HasArrayAccess;
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ class Tenant implements ArrayAccess, CurrentTenant
|
|||
public function save(): self
|
||||
{
|
||||
if ($this->persisted) {
|
||||
$this->manager->addTenant($this);
|
||||
$this->manager->createTenant($this);
|
||||
} else {
|
||||
$this->manager->updateTenant($this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue