mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-16 01:24:04 +00:00
Single DB tenancy
This commit is contained in:
parent
99d460f76e
commit
28019f4528
6 changed files with 335 additions and 3 deletions
23
src/Database/TenantCollection.php
Normal file
23
src/Database/TenantCollection.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\Database;
|
||||
|
||||
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(callable $callable): self
|
||||
{
|
||||
tenancy()->runForMultiple($this->items, $callable);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue