1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-15 09:54:03 +00:00
tenancy/src/Database/TenantCollection.php

26 lines
539 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()
*/
class TenantCollection extends Collection
{
public function runForEach(Closure $callable): self
{
tenancy()->runForMultiple($this->items, $callable);
return $this;
}
}