A role expiration

This commit is contained in:
a6a2f5842 2025-07-31 17:03:41 +02:00
parent 925b5f846f
commit 4488b7821f
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ trait HasRoles
config('roles.models.role', \Blax\Roles\Models\Role::class),
'member',
config('roles.table_names.role_members', 'role_members')
);
)->withPivot('expires_at', 'created_at', 'updated_at')
->withTimestamps()
->wherePivot('expires_at', '>', now())
->orWhereNull('expires_at');
}
/**