Skip to content

Commit 9630aed

Browse files
committed
Refactor key
1 parent ce96409 commit 9630aed

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Traits/WithReordering.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ public function disableReordering(): void
3434

3535
private function setReorderingSession(): void
3636
{
37-
session(['reordering-'.$this->tableName => true]);
37+
session([$this->getReorderingSessionKey() => true]);
3838
}
3939

4040
private function forgetReorderingSession(): void
4141
{
42-
session()->forget('reordering-'.$this->tableName);
42+
session()->forget($this->getReorderingSessionKey());
4343
}
4444

4545
private function hasReorderingSession(): bool
4646
{
47-
return session()->has('reordering-'.$this->tableName);
47+
return session()->has($this->getReorderingSessionKey());
4848
}
4949

5050
private function setReorderingProperties(): void
@@ -86,4 +86,9 @@ private function setReorderingProperties(): void
8686
]);
8787
}
8888
}
89+
90+
private function getReorderingSessionKey(): string
91+
{
92+
return $this->tableName.'-reordering';
93+
}
8994
}

0 commit comments

Comments
 (0)