Tenancy
class Tenancy (View source)
Traits
Properties
Tenant|null | $tenant | The current tenant. |
|
Closure|null | $getBootstrappersUsing | ||
bool | $initialized | Is tenancy fully initialized? |
Methods
Initialize tenancy for the passed tenant.
No description
No description
No description
Name of the column used to relate models to tenants.
Try to find a tenant using an ID.
Run a callback for multiple tenants.
Cached tenant resolvers used by the package.
Tenant identification middleware used by the package.
Default tenant identification middleware used by the package.
Details
void
initialize(Tenant|int|string $tenant)
Initialize tenancy for the passed tenant.
void
end()
No description
array
getBootstrappers()
No description
static Builder
query()
No description
static Tenant&Model
model()
No description
static string
tenantKeyColumn()
Name of the column used to relate models to tenants.
static Tenant|null
find(int|string $id)
Try to find a tenant using an ID.
mixed
central(Closure $callback)
Run a callback in the central context.
Atomic, safely reverts to previous context.
void
runForMultiple(Tenant[]|(string|int)[]|Traversable|string|int|null $tenants, Closure $callback)
Run a callback for multiple tenants.
More performant than running $tenant->run() one by one.
static array
cachedResolvers()
Cached tenant resolvers used by the package.
static array
middleware()
Tenant identification middleware used by the package.
static string
defaultMiddleware()
Default tenant identification middleware used by the package.