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

30 lines
849 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Contracts;
/**
* @see \Stancl\Tenancy\Database\Models\Tenant
*
* @method mixed __call() IDE support. This will be a model.
* @method mixed __callStatic() IDE support. This will be a model.
* @mixin \Illuminate\Database\Eloquent\Model
*/
interface Tenant
{
/** Get the name of the key used for identifying the tenant. */
public function getTenantKeyName(): string;
/** Get the value of the key used for identifying the tenant. */
public function getTenantKey(): ?string;
/** Get the value of an internal key. */
public function getInternal(string $key);
/** Set the value of an internal key. */
public function setInternal(string $key, $value);
/** Run a callback in this tenant's environment. */
public function run(callable $callback);
}