Skip to content

Commit 54a0951

Browse files
committed
support default value
1 parent 24f8649 commit 54a0951

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Settings.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ public function load(): static
8787
public function get(
8888
string $namespace,
8989
string $name,
90+
mixed $default = null
9091
): ?Setting {
91-
return $this->only($namespace)->firstWhere('name', $name);
92+
return $this->only($namespace)->firstWhere('name', $name) ?? $default;
9293
}
9394

9495
/**

0 commit comments

Comments
 (0)