File tree 1 file changed +7
-2
lines changed
resources/views/docs/desktop/1/the-basics
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,16 @@ To retrieve a setting, use the `get` method.
27
27
$value = Settings::get('key');
28
28
```
29
29
30
- You may also provide a default value to return if the setting does not exist.
30
+ You may also provide a default value to return if the setting does not exist. You can provide either a static default value, or a closure:
31
31
``` php
32
32
$value = Settings::get('key', 'default');
33
33
```
34
- If the setting does not exist, ` default ` will be returned.
34
+ ``` php
35
+ $value = Settings::get('key', function () {
36
+ return 'default';
37
+ });
38
+ ```
39
+ If the setting does not exist, and no default value is provided, ` null ` will be returned.
35
40
36
41
### Forgetting a value
37
42
If you want to remove a setting altogether, use the ` forget ` method.
You can’t perform that action at this time.
0 commit comments