1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Repositories\Enums;
- enum EmailConfigFieldEnum: string
- {
- case OPEN_EMAIL_NOTIFICATION = "email_notification"; //邮件通知
- public static function checkRules(): array
- {
- return [
- "email_notification" => "in:on,off",
- "async_sender" => "in:yes,no",
- "sender_email" => "nullable|email",
- "sender" => "nullable|min:1",
- "domain" => "nullable|url",
- "smtp_server" => "nullable|min:1",
- "smtp_account" => "nullable|min:1",
- "smtp_validation" => "in:yes,no",
- "smtp_port" => "nullable|numeric",
- "encryption" => "in:ssl,plain,tls",
- "smtp_password" => "nullable|min:6",
- "debug" => "in:off,normal,high",
- "charset" => "in:utf8,gbk"
- ];
- }
- public static function fieldRelations(): array
- {
- return [
- "sender_email" => "mail.from.address",
- "sender" => "mail.from.name",
- "domain" => "mail.mailers.smtp.url",
- "smtp_server" => "mail.mailers.smtp.host",
- "smtp_account" => "mail.mailers.smtp.username",
- "smtp_port" => "mail.mailers.smtp.port",
- "encryption" => "mail.mailers.smtp.encryption",
- "smtp_password" => "mail.mailers.smtp.password",
- ];
- }
- }
|