Skip to content

Commit f0c45dc

Browse files
author
Josh Holmer
committed
Add config() to helpers page
1 parent c8aa9c9 commit f0c45dc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

helpers.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Laravel includes a variety of "helper" PHP functions. Many of these functions ar
8787
### Miscellaneous
8888

8989
<div class="collection-method-list" markdown="1">
90+
[config](#method-config)
9091
[csrf_field](#method-csrf-field)
9192
[csrf_token](#method-csrf-token)
9293
[dd](#method-dd)
@@ -561,6 +562,16 @@ The `url` function generates a fully qualified URL to the given path:
561562
<a name="miscellaneous"></a>
562563
## Miscellaneous
563564

565+
<a name="method-config"></a>
566+
#### `config()` {#collection-method}
567+
568+
The `config` function gets the value of a configuration variable. The configuration values may be accessed using "dot" syntax, which includes the name of the file and option you wish to access. A default value may also be specified and will be returned if the configuration option does not exist:
569+
570+
$value = config('app.timezone');
571+
572+
// Return a default value if the variable doesn't exist...
573+
$value = config('app.timezone', 'America/Chicago');
574+
564575
<a name="method-csrf-field"></a>
565576
#### `csrf_field()` {#collection-method}
566577

0 commit comments

Comments
 (0)