Complete the code to get the value of 'app.name' from the config.
$appName = config('[1]');
The config() helper accesses configuration values by their key. To get the application name, use 'app.name'.
Complete the code to set the cache driver to 'redis' in the config at runtime.
config(['cache.default' => [1]]);
To change a config value at runtime, pass an array with the key and new value to config(). Here, we set 'cache.default' to 'redis'.
Fix the error in accessing the database host from config.
$dbHost = config('[1]'); // Expected to get '127.0.0.1' from config/database.php
The correct key to access the MySQL host is 'database.connections.mysql.host' because the config file is nested that way.
Fill both blanks to get the mail driver and set it to 'smtp' at runtime.
$mailDriver = config('[1]'); config(['[2]' => 'smtp']);
The mail driver is accessed and set using the key 'mail.default' in Laravel config.
Fill all three blanks to create a config array with keys 'app.env', 'app.debug', and 'app.url'.
$settings = [ '[1]' => config('[2]'), '[3]' => config('app.url') ];
The array keys and config keys must match. 'app.env' and 'app.debug' are used to get environment and debug settings, and 'app.url' is used directly.