mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
Merge branch 'master' of gitlab.com:mohit.panjvani/crater-web
This commit is contained in:
@ -75,9 +75,19 @@ class EnvironmentController extends Controller
|
||||
'mail_port' => config('mail.port'),
|
||||
'mail_username' => config('mail.username'),
|
||||
'mail_password' => config('mail.password'),
|
||||
'mail_encryption' => config('mail.encryption')
|
||||
'mail_encryption' => config('mail.encryption'),
|
||||
'from_name' => config('mail.from.name'),
|
||||
'from_mail' => config('mail.from.address'),
|
||||
'mail_mailgun_endpoint' => config('services.mailgun.endpoint'),
|
||||
'mail_mailgun_domain' => config('services.mailgun.domain'),
|
||||
'mail_mailgun_secret' => config('services.mailgun.secret'),
|
||||
'mail_sparkpost_secret' => config('services.sparkpost.secret'),
|
||||
'mail_ses_key' => config('services.ses.key'),
|
||||
'mail_ses_secret' => config('services.ses.secret'),
|
||||
'mail_mandrill_secret' => config('services.mandrill.secret'),
|
||||
];
|
||||
|
||||
|
||||
return response()->json($MailData);
|
||||
}
|
||||
|
||||
|
||||
@ -23,13 +23,85 @@ class MailEnvironmentRequest extends FormRequest
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_username' => 'required|string|max:50',
|
||||
'mail_password' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
];
|
||||
switch ($this->get('mail_driver')) {
|
||||
case 'smtp':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_username' => 'required|string|max:50',
|
||||
'mail_password' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'mailgun':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_mailgun_domain' => 'required|string|max:50',
|
||||
'mail_mailgun_secret' => 'required|string|max:50',
|
||||
'mail_mailgun_endpoint' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'sparkpost':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_sparkpost_secret' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'ses':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_ses_key' => 'required|string|max:50',
|
||||
'mail_ses_secret' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'mail':
|
||||
return [
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'sendmail':
|
||||
return [
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'mandrill':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_mandrill_secret' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user