Fix write env to work with nulls and change from to address

This commit is contained in:
Joseph Cohen
2016-06-11 15:23:02 -05:00
committed by James Brooks
parent 1fe4789760
commit a5ed3c40a9
3 changed files with 9 additions and 7 deletions

View File

@@ -149,7 +149,7 @@ class SetupController extends Controller
return $input->mail_driver === 'smtp';
});
$v->sometimes(['env.mail_from', 'env.mail_username', 'env.mail_password'], 'required', function ($input) {
$v->sometimes(['env.mail_address', 'env.mail_username', 'env.mail_password'], 'required', function ($input) {
return $input->mail_driver !== 'log';
});
@@ -250,8 +250,10 @@ class SetupController extends Controller
try {
(new Dotenv($dir, $file))->load();
$envValue = env(strtoupper($key)) ?: 'null';
file_put_contents($path, str_replace(
env(strtoupper($key)), $value, file_get_contents($path)
$envValue, $value, file_get_contents($path)
));
} catch (InvalidPathException $e) {
//