From 75ce19e4a9b8ff3ccc32b5d7ee69dc7607d9239b Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 30 Sep 2022 10:38:43 +0200 Subject: [PATCH] Make `createPending()` return the created tenant --- src/Database/Concerns/HasPending.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Database/Concerns/HasPending.php b/src/Database/Concerns/HasPending.php index f6b61881..0a830556 100644 --- a/src/Database/Concerns/HasPending.php +++ b/src/Database/Concerns/HasPending.php @@ -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