You may easily access your configuration values using the global config helper 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:
$value = config('app.timezone');
あーなるほど、configの値を持ってこれるのね。面白いなこれ。
To set configuration values at runtime, pass an array to the config helper:
config(['app.timezone' => 'America/Chicago']);
なるほど、なるほど。完全にドキュメントを先に学んだ方がいいね、これは。
Configuration Caching
To give your application a speed boost, you should cache all of your configuration files into a single file using the config:cache Artisan command. This will combine all of the configuration options for your application into a single file which will be loaded quickly by the framework.
config:cacheを使えと言ってます。
Maintenance Mode
When your application is in maintenance mode, a custom view will be displayed for all requests into your application. This makes it easy to “disable” your application while it is updating or when you are performing maintenance. A maintenance mode check is included in the default middleware stack for your application. If the application is in maintenance mode, a MaintenanceModeException will be thrown with a status code of 503.
php artisan down
実務的にはよく使います。これは、503.phpを表示させたい。
You may also provide message and retry options to the down command. The message value may be used to display or log a custom message, while the retry value will be set as the Retry-After HTTP header’s value:
php artisan down --message="Upgrading Database" --retry=60
Even while in maintenance mode, specific IP addresses or networks may be allowed to access the application using the command’s allow option:
php artisan down --allow=127.0.0.1 --allow=192.168.0.0/16
これすげーーーーー、こんなの出来るんだ。
To disable maintenance mode, use the up command:
php artisan up
Maintenance Mode & Queues
While your application is in maintenance mode, no queued jobs will be handled. The jobs will continue to be handled as normal once the application is out of maintenance mode.
Alternatives To Maintenance Mode
Since maintenance mode requires your application to have several seconds of downtime, consider alternatives like Envoyer to accomplish zero-downtime deployment with Laravel.
なるほどばっかだーーーーー