From 9414b17f0658974edd2feb4d33d4850e9e9b5f3a Mon Sep 17 00:00:00 2001 From: lukinovec Date: Mon, 28 Nov 2022 14:43:16 +0100 Subject: [PATCH] Improve query formatting --- src/Commands/ClearPendingTenants.php | 3 +-- src/Commands/CreatePendingTenants.php | 3 +-- src/Concerns/HasTenantOptions.php | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Commands/ClearPendingTenants.php b/src/Commands/ClearPendingTenants.php index 17a1fab6..2297dbe9 100644 --- a/src/Commands/ClearPendingTenants.php +++ b/src/Commands/ClearPendingTenants.php @@ -41,8 +41,7 @@ class ClearPendingTenants extends Command $expirationDate->subHours($olderThanHours); } - $deletedTenantCount = tenancy() - ->query() + $deletedTenantCount = tenancy()->query() ->onlyPending() ->when($originalExpirationDate->notEqualTo($expirationDate), function (Builder $query) use ($expirationDate) { $query->where($query->getModel()->getColumnForQuery('pending_since'), '<', $expirationDate->timestamp); diff --git a/src/Commands/CreatePendingTenants.php b/src/Commands/CreatePendingTenants.php index 7b2c7934..9b38b71f 100644 --- a/src/Commands/CreatePendingTenants.php +++ b/src/Commands/CreatePendingTenants.php @@ -39,8 +39,7 @@ class CreatePendingTenants extends Command /** Calculate the number of currently available pending tenants. */ protected function getPendingTenantCount(): int { - return tenancy() - ->query() + return tenancy()->query() ->onlyPending() ->count(); } diff --git a/src/Concerns/HasTenantOptions.php b/src/Concerns/HasTenantOptions.php index f8a763a7..b558da64 100644 --- a/src/Concerns/HasTenantOptions.php +++ b/src/Concerns/HasTenantOptions.php @@ -23,8 +23,7 @@ trait HasTenantOptions protected function getTenants(): LazyCollection { - return tenancy() - ->query() + return tenancy()->query() ->when($this->option('tenants'), function ($query) { $query->whereIn(tenancy()->model()->getTenantKeyName(), $this->option('tenants')); })