What is a good way to change a configuration file based on whether the application is in maintenance mode?
Let's say I have a config file with the following.
<?php
return [
'contactFormRecipients' =>
[
'[email protected]', '[email protected]',
'[email protected]'
]
];
Now I want something like this
use Illuminate\Support\Facades\App;
if (App::isDownForMaintenance()) {
return [
'contactFormRecipients' => ['[email protected]'],
];
}
return [
'contactFormRecipients' => [
'[email protected]',
'[email protected]',
'[email protected]',
],
];
However, this doesn't seem to work. I'm guessing it has to do with how the framework is booted because the App Facade in the 2nd example throws an error. When I try to run the code, I can't even get php artisan commands to execute because it says there is an error in the Facade.php file.