mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:44:04 +00:00
Fix runForMultiple() for incrementing tenant ids
This commit is contained in:
parent
bc9867b152
commit
0442be42de
1 changed files with 4 additions and 1 deletions
|
|
@ -93,6 +93,9 @@ class Tenancy
|
||||||
*/
|
*/
|
||||||
public function runForMultiple($tenants, callable $callback)
|
public function runForMultiple($tenants, callable $callback)
|
||||||
{
|
{
|
||||||
|
// Convert incrementing int ids to strings
|
||||||
|
$tenants = is_int($tenants) ? (string) $tenants : $tenants;
|
||||||
|
|
||||||
// Wrap string in array
|
// Wrap string in array
|
||||||
$tenants = is_string($tenants) ? [$tenants] : $tenants;
|
$tenants = is_string($tenants) ? [$tenants] : $tenants;
|
||||||
|
|
||||||
|
|
@ -102,7 +105,7 @@ class Tenancy
|
||||||
$originalTenant = $this->tenant;
|
$originalTenant = $this->tenant;
|
||||||
|
|
||||||
foreach ($tenants as $tenant) {
|
foreach ($tenants as $tenant) {
|
||||||
if (is_string($tenant)) {
|
if (! $tenant instanceof Tenant) {
|
||||||
$tenant = $this->find($tenant);
|
$tenant = $this->find($tenant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue