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

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.

setInternal(string $key, mixed $value)

Set internal key.

mixed
run(Closure $callback)

Run a callback in this tenant's 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.

newCollection(array $models = [])

No description

all(mixed $columns)

No description

Details

getConnectionName()

No description

static void bootGeneratesIds()

No description

Return Value

void

getIncrementing()

No description

bool shouldGenerateId()

No description

Return Value

bool

getKeyType()

No description

static string internalPrefix()

Get the internal prefix.

Return Value

string

mixed getInternal(string $key)

Get an internal key.

Parameters

string $key

Return Value

mixed

HasInternalKeys setInternal(string $key, mixed $value)

Set internal key.

Parameters

string $key
mixed $value

Return Value

HasInternalKeys

mixed run(Closure $callback)

Run a callback in this tenant's context.

This method is atomic and safely reverts to the previous context.

Parameters

Closure $callback

Return Value

mixed

static void bootHasPending()

Boot the trait.

Return Value

void

void initializeHasPending()

Initialize the trait.

Return Value

void

bool pending()

Determine if the model instance is in a pending state.

Return Value

bool

static Model&Tenant createPending(array $attributes = [])

Create a pending tenant.

Parameters

array $attributes

Return Value

Model&Tenant

static Model&Tenant pullPending()

Pull a pending tenant.

Return Value

Model&Tenant

static Tenant|null pullPendingFromPool(bool $firstOrCreate = false)

Try to pull a tenant from the pool of pending tenants.

Parameters

bool $firstOrCreate

Return Value

Tenant|null

static Builder withPending(bool $withPending = true)

No description

Parameters

bool $withPending

Return Value

Builder

static Builder onlyPending()

No description

Return Value

Builder

static Builder withoutPending()

No description

Return Value

Builder

void enter()

No description

Return Value

void

void leave()

No description

Return Value

void

static void bootInvalidatesResolverCache()

No description

Return Value

void

string getTenantKeyName()

Get the name of the key used for identifying the tenant.

Return Value

string

int|string getTenantKey()

Get the value of the key used for identifying the tenant.

Return Value

int|string

static static|null current()

Get the current tenant.

Return Value

static|null

static Tenant currentOrFail()

Get the current tenant or throw an exception if tenancy is not initialized.

Return Value

Tenant

Exceptions

TenancyNotInitializedException

TenantCollection newCollection(array $models = [])

No description

Parameters

array $models

Return Value

TenantCollection

static TenantCollection all(mixed $columns)

No description

Parameters

mixed $columns

Return Value

TenantCollection