mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:14:04 +00:00
28 lines
599 B
PHP
28 lines
599 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Database\Concerns;
|
|
|
|
trait HasInternalKeys
|
|
{
|
|
/** Get the internal prefix. */
|
|
public static function internalPrefix(): string
|
|
{
|
|
return 'tenancy_';
|
|
}
|
|
|
|
/** Get an internal key. */
|
|
public function getInternal(string $key): mixed
|
|
{
|
|
return $this->getAttribute(static::internalPrefix() . $key);
|
|
}
|
|
|
|
/** Set internal key. */
|
|
public function setInternal(string $key, mixed $value): static
|
|
{
|
|
$this->setAttribute(static::internalPrefix() . $key, $value);
|
|
|
|
return $this;
|
|
}
|
|
}
|