1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14:04 +00:00

[4.x] Make the ImpersonationToken model configurable (#1335)

* Make the ImpersonationToken model configurable, resolve #1315

* Add type definition

* Make phpstan happy
This commit is contained in:
Samuel Štancl 2025-03-18 18:42:08 +01:00 committed by GitHub
parent 37a0f1a713
commit 95dd906de2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 6 deletions

View file

@ -25,6 +25,9 @@ class ImpersonationToken extends Model
{
use CentralConnection;
/** You can set this property to customize the table name */
public static string $tableName = 'tenant_user_impersonation_tokens';
protected $guarded = [];
public $timestamps = false;
@ -33,11 +36,15 @@ class ImpersonationToken extends Model
public $incrementing = false;
protected $table = 'tenant_user_impersonation_tokens';
protected $casts = [
'created_at' => 'datetime',
];
public function getTable()
{
return static::$tableName;
}
public static function booted(): void
{
static::creating(function ($model) {