Fix write env to work with nulls and change from to address
This commit is contained in:
committed by
James Brooks
parent
1fe4789760
commit
a5ed3c40a9
@@ -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) {
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@ return [
|
||||
'session_driver' => 'Session Driver',
|
||||
'mail_driver' => 'Mail Driver',
|
||||
'mail_host' => 'Mail Host',
|
||||
'mail_from' => 'Mail From',
|
||||
'mail_address' => 'Mail From',
|
||||
'mail_username' => 'Mail Client User',
|
||||
'mail_password' => 'Mail Client Password',
|
||||
],
|
||||
|
||||
@@ -76,10 +76,10 @@
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{ trans('forms.setup.mail_from') }}</label>
|
||||
<input type="text" class="form-control" name="env[mail_from]" value="{{ Binput::old('env.mail_from') }}" placeholder="notifications@alt-three.com">
|
||||
@if($errors->has('env.mail_from'))
|
||||
<span class="text-danger">{{ $errors->first('env.mail_from') }}</span>
|
||||
<label>{{ trans('forms.setup.mail_address') }}</label>
|
||||
<input type="text" class="form-control" name="env[mail_address]" value="{{ Binput::old('env.mail_address') }}" placeholder="notifications@alt-three.com">
|
||||
@if($errors->has('env.mail_address'))
|
||||
<span class="text-danger">{{ $errors->first('env.mail_address') }}</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
Reference in New Issue
Block a user