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

74 lines
2.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
{
2020-01-04 17:27:21 +08:00
CONST RULES = [
2020-01-31 17:13:30 +08:00
'invite.invite_force' => 'in:0,1',
'invite.invite_commission' => 'integer',
'invite.invite_gen_limit' => 'integer',
'invite.invite_never_expire' => 'in:0,1',
'site.stop_register' => 'in:0,1',
'site.email_verify' => 'in:0,1',
'site.app_name' => '',
'site.app_url' => 'url',
'site.subscribe_url' => 'url',
'site.plan_transfer_hour' => 'numeric',
'site.plan_change_enable' => 'in:0,1',
'site.try_out_enable' => 'in:0,1',
'site.try_out_plan_id' => 'integer',
'site.try_out_hour' => 'numeric',
2020-01-04 17:27:21 +08:00
// server
2020-01-31 17:13:30 +08:00
'server.server_token' => 'nullable|min:16',
'server.server_license' => 'nullable',
2020-01-04 17:27:21 +08:00
// alipay
2020-01-31 17:13:30 +08:00
'pay.alipay_enable' => 'in:0,1',
'pay.alipay_appid' => 'nullable|integer|min:16',
'pay.alipay_pubkey' => 'max:2048',
'pay.alipay_privkey' => 'max:2048',
2020-01-04 17:27:21 +08:00
// stripe
2020-01-31 17:13:30 +08:00
'pay.stripe_alipay_enable' => 'in:0,1',
'pay.stripe_wepay_enable' => 'in:0,1',
'pay.stripe_sk_live' => '',
'pay.stripe_pk_live' => '',
'pay.stripe_webhook_key' => '',
2020-01-04 17:27:21 +08:00
// bitpayx
2020-01-31 17:13:30 +08:00
'pay.bitpayx_enable' => 'in:0,1',
'pay.bitpayx_appsecret' => '',
2020-01-14 00:29:59 +08:00
// paytaro
2020-01-31 17:13:30 +08:00
'pay.paytaro_enable' => 'in:0,1',
'pay.paytaro_app_id' => '',
'pay.paytaro_app_secret' => '',
2020-01-20 16:16:59 +08:00
// frontend
2020-01-31 17:13:30 +08:00
'frontend.frontend_theme' => 'in:1,2',
'frontend.frontend_background_url' => 'nullable|url',
2020-01-04 17:27:21 +08:00
// tutorial
2020-01-31 17:13:30 +08:00
'tutorial.apple_id' => 'email',
'tutorial.apple_id_password' => ''
2020-01-04 17:27:21 +08:00
];
2020-01-11 13:36:52 +08:00
public static function filter()
{
2020-01-04 17:27:21 +08:00
return array_keys(self::RULES);
2019-10-29 15:33:36 +08:00
}
2020-01-11 13:36:52 +08:00
2019-10-29 15:33:36 +08:00
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
2020-01-04 17:27:21 +08:00
return self::RULES;
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()
{
return [
];
}
}