mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:14:04 +00:00
Make createPending() return the created tenant
This commit is contained in:
parent
7a0eaeb007
commit
75ce19e4a9
1 changed files with 3 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ trait HasPending
|
||||||
return ! is_null($this->pending_since);
|
return ! is_null($this->pending_since);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createPending($attributes = []): void
|
public static function createPending($attributes = []): Tenant
|
||||||
{
|
{
|
||||||
$tenant = static::create($attributes);
|
$tenant = static::create($attributes);
|
||||||
|
|
||||||
|
|
@ -62,6 +62,8 @@ trait HasPending
|
||||||
]);
|
]);
|
||||||
|
|
||||||
event(new PendingTenantCreated($tenant));
|
event(new PendingTenantCreated($tenant));
|
||||||
|
|
||||||
|
return $tenant;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function pullPendingTenant(bool $firstOrCreate = false): ?Tenant
|
public static function pullPendingTenant(bool $firstOrCreate = false): ?Tenant
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue