1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 18:34:04 +00:00

Make createPending() return the created tenant

This commit is contained in:
lukinovec 2022-09-30 10:38:43 +02:00 committed by GitHub
parent 7a0eaeb007
commit 75ce19e4a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ trait HasPending
return ! is_null($this->pending_since);
}
public static function createPending($attributes = []): void
public static function createPending($attributes = []): Tenant
{
$tenant = static::create($attributes);
@ -62,6 +62,8 @@ trait HasPending
]);
event(new PendingTenantCreated($tenant));
return $tenant;
}
public static function pullPendingTenant(bool $firstOrCreate = false): ?Tenant