Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ public function set(string $key, $value): void

public function get(string $key, $default = null): mixed
{
return $this->client->get('settings/'.$key)->json('value') ?? $default;
$response = $this->client->get('settings/'.$key)->json('value');

if ($response === null) {
return $default instanceof \Closure ? $default() : $default;
}

return $response;
}

public function forget(string $key): void
Expand Down
Loading