Skip to content

Commit bddb6cb

Browse files
committed
fix: replace hardcoded db table
1 parent dda2d8b commit bddb6cb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Auth/UsesRoles.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public function assign($role): bool
3535
$roleKey = Config::get('roles.key');
3636

3737
if (!($this->data[$roleKey] ?? null)) {
38-
$this->db->query("ALTER TABLE users ADD COLUMN $roleKey TEXT NOT NULL DEFAULT '[]'")->execute();
38+
$this->db->query("ALTER TABLE " . Config::get('db.table') . " ADD COLUMN $roleKey TEXT NOT NULL DEFAULT '[]'")->execute();
3939
}
4040

4141
try {
4242
$this->db
43-
->update('users')
43+
->update(Config::get('db.table'))
4444
->params([
4545
$roleKey => json_encode($this->roles)
4646
])
@@ -129,7 +129,7 @@ public function unassign($role): void
129129
$this->permissions = $this->getRolePermissions($this->roles);
130130

131131
$this->db
132-
->update('users')
132+
->update(Config::get('db.table'))
133133
->params([
134134
Config::get('roles.key') => json_encode($this->roles)
135135
])

0 commit comments

Comments
 (0)