Skip to content

Commit

Permalink
Merge pull request #3294 from anthonybocci/setup-requires-username-3244
Browse files Browse the repository at this point in the history
Set the mail username optional in setup
  • Loading branch information
jbrooksuk committed Dec 29, 2018
2 parents 59df070 + cecf894 commit e857143
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Http/Controllers/SetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,14 @@ public function postStep1()
return $input->env['mail_driver'] === 'smtp';
});

$v->sometimes(['env.mail_address', 'env.mail_username', 'env.mail_password'], 'required', function ($input) {
$v->sometimes(['env.mail_address', 'env.mail_password'], 'required', function ($input) {
return !in_array($input->env['mail_driver'], ['log', 'smtp']);
});

$v->sometimes(['env.mail_username'], 'required', function($input) {
return !in_array($input->env['mail_username'], ['sendmail']);
});

if ($v->passes()) {
return Response::json(['status' => 1]);
}
Expand Down

0 comments on commit e857143

Please sign in to comment.