1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-07 22:04:04 +00:00
tenancy/src/Database/TenantCollection.php

28 lines
621 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Database;
use Closure;
use Illuminate\Database\Eloquent\Collection;
use Stancl\Tenancy\Contracts\Tenant;
/**
* @property Tenant[] $items
* @method void __construct(Tenant[] $items = [])
* @method Tenant[] toArray()
* @method Tenant offsetGet($key)
* @method Tenant first()
*
* @extends Collection<int|string, Tenant&\Illuminate\Database\Eloquent\Model>
*/
class TenantCollection extends Collection
{
public function runForEach(Closure $callable): self
{
tenancy()->runForMultiple($this->items, $callable);
return $this;
}
}