Skip to content

Commit d1addfe

Browse files
committed
wip
1 parent 1b9e3ad commit d1addfe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

configuration.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,20 @@ php artisan env:decrypt --force
185185
<a name="accessing-configuration-values"></a>
186186
## Accessing Configuration Values
187187

188-
You may easily access your configuration values using the global `config` function from anywhere in your application. 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:
188+
You may easily access your configuration values using the `Config` facade or global `config` function from anywhere in your application. 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:
189+
190+
use Illuminate\Support\Facades\Config;
191+
192+
$value = Config::get('app.timezone');
189193

190194
$value = config('app.timezone');
191195

192196
// Retrieve a default value if the configuration value does not exist...
193197
$value = config('app.timezone', 'Asia/Seoul');
194198

195-
To set configuration values at runtime, pass an array to the `config` function:
199+
To set configuration values at runtime, you may invoke the `Config` facade's `set` method or pass an array to the `config` function:
200+
201+
Config::set('app.timezone', 'America/Chicago');
196202

197203
config(['app.timezone' => 'America/Chicago']);
198204

0 commit comments

Comments
 (0)