v2board/app/Http/Requests/Admin/ConfigSave.php

138 lines
5.1 KiB
PHP
Raw Normal View History

2019-10-29 15:33:36 +08:00
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class ConfigSave extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
2020-07-15 15:57:12 +08:00
return [
// invite & commission
'safe_mode_enable' => 'in:0,1',
'invite_force' => 'in:0,1',
'invite_commission' => 'integer',
'invite_gen_limit' => 'integer',
'invite_never_expire' => 'in:0,1',
'commission_first_time_enable' => 'in:0,1',
'commission_auto_check_enable' => 'in:0,1',
2020-10-29 00:37:37 +08:00
'commission_withdraw_limit' => 'nullable|numeric',
2021-01-08 00:33:11 +08:00
'commission_withdraw_method' => 'nullable|array',
2021-02-03 18:17:32 +08:00
'withdraw_close_enable' => 'in:0,1',
2021-09-18 19:53:34 +08:00
'commission_distribution_enable' => 'in:0,1',
'commission_distribution_l1' => 'nullable|numeric',
'commission_distribution_l2' => 'nullable|numeric',
'commission_distribution_l3' => 'nullable|numeric',
2020-07-15 15:57:12 +08:00
// site
'stop_register' => 'in:0,1',
'email_verify' => 'in:0,1',
'app_name' => '',
'app_description' => '',
'app_url' => 'nullable|url',
2021-07-06 17:04:59 +08:00
'subscribe_url' => 'nullable',
2020-07-15 15:57:12 +08:00
'try_out_enable' => 'in:0,1',
'try_out_plan_id' => 'integer',
'try_out_hour' => 'numeric',
'email_whitelist_enable' => 'in:0,1',
2021-01-08 00:33:11 +08:00
'email_whitelist_suffix' => 'nullable|array',
2020-07-15 15:57:12 +08:00
'email_gmail_limit_enable' => 'in:0,1',
2020-10-09 23:27:36 +08:00
'recaptcha_enable' => 'in:0,1',
'recaptcha_key' => '',
'recaptcha_site_key' => '',
2021-05-06 23:12:58 +08:00
'tos_url' => 'nullable|url',
2021-11-14 02:43:41 +08:00
'currency' => '',
'currency_symbol' => '',
2020-07-15 15:57:12 +08:00
// subscribe
'plan_change_enable' => 'in:0,1',
2021-09-06 01:31:45 +08:00
'reset_traffic_method' => 'in:0,1,2',
'surplus_enable' => 'in:0,1',
2021-07-01 21:04:22 +08:00
'new_order_event_id' => 'in:0,1',
'renew_order_event_id' => 'in:0,1',
'change_order_event_id' => 'in:0,1',
2020-07-15 15:57:12 +08:00
// server
'server_token' => 'nullable|min:16',
'server_license' => 'nullable',
2020-07-26 17:17:35 +08:00
'server_log_enable' => 'in:0,1',
'server_v2ray_domain' => '',
'server_v2ray_protocol' => '',
2020-07-15 15:57:12 +08:00
// alipay
'alipay_enable' => 'in:0,1',
'alipay_appid' => 'nullable|integer|min:16',
'alipay_pubkey' => 'max:2048',
'alipay_privkey' => 'max:2048',
// stripe
'stripe_alipay_enable' => 'in:0,1',
'stripe_wepay_enable' => 'in:0,1',
'stripe_card_enable' => 'in:0,1',
'stripe_sk_live' => '',
'stripe_pk_live' => '',
'stripe_webhook_key' => '',
2020-08-22 14:28:47 +08:00
'stripe_currency' => 'in:hkd,usd,sgd,eur,gbp,jpy,cad',
2020-07-15 15:57:12 +08:00
// bitpayx
'bitpayx_name' => '',
'bitpayx_enable' => 'in:0,1',
'bitpayx_appsecret' => '',
2020-07-20 19:56:39 +08:00
// mGate
'mgate_name' => '',
'mgate_enable' => 'in:0,1',
'mgate_url' => 'nullable|url',
'mgate_app_id' => '',
'mgate_app_secret' => '',
2020-07-17 21:20:43 +08:00
// Epay
'epay_name' => '',
'epay_enable' => 'in:0,1',
2020-07-17 23:25:46 +08:00
'epay_url' => 'nullable|url',
2020-07-17 21:20:43 +08:00
'epay_pid' => '',
'epay_key' => '',
2020-07-15 15:57:12 +08:00
// frontend
2021-07-29 01:41:31 +08:00
'frontend_theme' => '',
2020-07-15 15:57:12 +08:00
'frontend_theme_sidebar' => 'in:dark,light',
'frontend_theme_header' => 'in:dark,light',
2021-08-12 16:17:36 +08:00
'frontend_theme_color' => 'in:default,darkblue,black,green',
2020-07-15 15:57:12 +08:00
'frontend_background_url' => 'nullable|url',
2020-07-17 20:01:28 +08:00
'frontend_admin_path' => '',
2021-03-25 17:26:22 +08:00
'frontend_customer_service_method' => '',
'frontend_customer_service_id' => '',
2020-07-15 15:57:12 +08:00
// email
'email_template' => '',
2020-08-19 15:41:31 +08:00
'email_host' => '',
'email_port' => '',
'email_username' => '',
'email_password' => '',
'email_encryption' => '',
'email_from_address' => '',
2020-07-15 15:57:12 +08:00
// telegram
'telegram_bot_enable' => 'in:0,1',
'telegram_bot_token' => '',
'telegram_discuss_id' => '',
2020-11-19 21:21:21 +08:00
'telegram_channel_id' => '',
2021-12-17 01:53:03 +08:00
'telegram_discuss_link' => 'nullable|url',
2020-11-19 21:21:21 +08:00
// app
'windows_version' => '',
'windows_download_url' => '',
'macos_version' => '',
'macos_download_url' => '',
'android_version' => '',
'android_download_url' => ''
2020-07-15 15:57:12 +08:00
];
2019-10-29 15:33:36 +08:00
}
2020-01-11 13:36:52 +08:00
2019-10-29 15:33:36 +08:00
public function messages()
{
2020-03-02 00:14:58 +08:00
// illiteracy prompt
2019-10-29 15:33:36 +08:00
return [
2020-03-02 00:14:58 +08:00
'app_url.url' => '站点URL格式不正确必须携带http(s)://',
2021-03-26 01:20:53 +08:00
'subscribe_url.url' => '订阅URL格式不正确必须携带http(s)://',
2021-05-06 23:12:58 +08:00
'server_token.min' => '通讯密钥长度必须大于16位',
2021-12-17 01:53:03 +08:00
'tos_url.url' => '服务条款URL格式不正确必须携带http(s)://',
'telegram_discuss_link.url' => 'Telegram群组地址必须为URL格式必须携带http(s)://'
2019-10-29 15:33:36 +08:00
];
}
}