File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
resources/views/docs/desktop/1/the-basics Expand file tree Collapse file tree 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.
2727$value = Settings::get('key');
2828```
2929
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:
3131``` php
3232$value = Settings::get('key', 'default');
3333```
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.
3540
3641### Forgetting a value
3742If you want to remove a setting altogether, use the ` forget ` method.
You can’t perform that action at this time.
0 commit comments