Tenant
class Tenant extends Model implements Tenant (View source)
Traits
Properties
Carbon | $pending_since | from HasPending | |
static protected | $modelsShouldPreventAccessingMissingAttributes | ||
protected | $table | ||
protected | $primaryKey | ||
protected | $guarded | ||
protected | $dispatchesEvents | ||
string|int | $id | ||
Carbon | $created_at | ||
Carbon | $updated_at | ||
array | $data |
Methods
Try to pull a tenant from the pool of pending tenants.
Get the name of the key used for identifying the tenant.
Get the value of the key used for identifying the tenant.
Get the current tenant.
Get the current tenant or throw an exception if tenancy is not initialized.
No description
No description
Details
getConnectionName()
No description
static void
bootGeneratesIds()
No description
getIncrementing()
No description
bool
shouldGenerateId()
No description
getKeyType()
No description
static string
internalPrefix()
Get the internal prefix.
mixed
getInternal(string $key)
Get an internal key.
HasInternalKeys
setInternal(string $key, mixed $value)
Set internal key.
mixed
run(Closure $callback)
Run a callback in this tenant's context.
This method is atomic and safely reverts to the previous context.
static void
bootHasPending()
Boot the trait.
void
initializeHasPending()
Initialize the trait.
bool
pending()
Determine if the model instance is in a pending state.
static Model&Tenant
createPending(array $attributes = [])
Create a pending tenant.
static Model&Tenant
pullPending()
Pull a pending tenant.
static Tenant|null
pullPendingFromPool(bool $firstOrCreate = false)
Try to pull a tenant from the pool of pending tenants.
static Builder
withPending(bool $withPending = true)
No description
static Builder
onlyPending()
No description
static Builder
withoutPending()
No description
void
enter()
No description
void
leave()
No description
static void
bootInvalidatesResolverCache()
No description
string
getTenantKeyName()
Get the name of the key used for identifying the tenant.
int|string
getTenantKey()
Get the value of the key used for identifying the tenant.
static static|null
current()
Get the current tenant.
static Tenant
currentOrFail()
Get the current tenant or throw an exception if tenancy is not initialized.
TenantCollection
newCollection(array $models = [])
No description
static TenantCollection
all(mixed $columns)
No description