Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7552867 commit 11cb34fCopy full SHA for 11cb34f
src/Settings.php
@@ -17,7 +17,13 @@ public function set(string $key, $value): void
17
18
public function get(string $key, $default = null): mixed
19
{
20
- return $this->client->get('settings/'.$key)->json('value') ?? $default;
+ $response = $this->client->get('settings/'.$key)->json('value');
21
+
22
+ if ($response === null) {
23
+ return $default instanceof \Closure ? $default() : $default;
24
+ }
25
26
+ return $response;
27
}
28
29
public function forget(string $key): void
0 commit comments