1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 02:24:03 +00:00

Improve code of pending tenants (#1025)

* Remove `--all` option from ClearPendingTenants

* Improve query formatting

* Remove redundant test

* Convert time constrait options to int

* Improve CreatePendingTenants success message
This commit is contained in:
lukinovec 2022-11-29 09:31:07 +01:00 committed by GitHub
parent 73c5655bc8
commit 7d3298c6bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 46 deletions

View file

@ -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'));
})