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

75 lines
1.9 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-02-08 15:26:18 +08:00
'save_mode' => 'in:0,1',
2020-01-31 17:18:00 +08:00
'invite_force' => 'in:0,1',
'invite_commission' => 'integer',
'invite_gen_limit' => 'integer',
'invite_never_expire' => 'in:0,1',
'stop_register' => 'in:0,1',
'email_verify' => 'in:0,1',
'app_name' => '',
'app_url' => 'url',
'subscribe_url' => 'url',
'plan_transfer_hour' => 'numeric',
'plan_change_enable' => 'in:0,1',
'try_out_enable' => 'in:0,1',
'try_out_plan_id' => 'integer',
'try_out_hour' => 'numeric',
2020-01-04 17:27:21 +08:00
// server
2020-01-31 17:18:00 +08:00
'server_token' => 'nullable|min:16',
'server_license' => 'nullable',
2020-01-04 17:27:21 +08:00
// alipay
2020-01-31 17:18:00 +08:00
'alipay_enable' => 'in:0,1',
'alipay_appid' => 'nullable|integer|min:16',
'alipay_pubkey' => 'max:2048',
'alipay_privkey' => 'max:2048',
2020-01-04 17:27:21 +08:00
// stripe
2020-01-31 17:18:00 +08:00
'stripe_alipay_enable' => 'in:0,1',
'stripe_wepay_enable' => 'in:0,1',
'stripe_sk_live' => '',
'stripe_pk_live' => '',
'stripe_webhook_key' => '',
2020-01-04 17:27:21 +08:00
// bitpayx
2020-01-31 17:18:00 +08:00
'bitpayx_enable' => 'in:0,1',
'bitpayx_appsecret' => '',
2020-01-14 00:29:59 +08:00
// paytaro
2020-01-31 17:18:00 +08:00
'paytaro_enable' => 'in:0,1',
'paytaro_app_id' => '',
'paytaro_app_secret' => '',
2020-01-20 16:16:59 +08:00
// frontend
2020-01-31 17:18:00 +08:00
'frontend_theme' => 'in:1,2',
'frontend_background_url' => 'nullable|url',
2020-01-04 17:27:21 +08:00
// tutorial
2020-01-31 17:18:00 +08:00
'apple_id' => 'email',
2020-01-31 21:39:32 +08:00
'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 [
];
}
}