Skip to content

Commit d408806

Browse files
committed
Added 'has' method to Settings class to check for existence of a specific key
1 parent 540e9a4 commit d408806

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Settings.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public function get(string $key, $default = null): mixed
2020
return $this->client->get('settings/'.$key)->json('value') ?? $default;
2121
}
2222

23+
public function has(string $key): bool
24+
{
25+
return $this->client->get('settings/'.$key)->json('value') !== null;
26+
}
27+
2328
public function forget(string $key): void
2429
{
2530
$this->client->delete('settings/'.$key);

0 commit comments

Comments
 (0)