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:
parent
37a0f1a713
commit
95dd906de2
3 changed files with 26 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue