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

65 lines
1.7 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 = [
'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',
2020-01-04 17:36:31 +08:00
'app_name' => '',
2020-01-04 17:27:21 +08:00
'app_url' => 'url',
'subscribe_url' => 'url',
2020-01-05 23:30:07 +08:00
'plan_transfer_hour' => 'numeric',
2020-01-04 17:27:21 +08:00
'plan_is_update' => 'in:0,1',
2020-01-04 17:46:53 +08:00
'try_out_enable' => 'in:0,1',
2020-01-04 17:27:21 +08:00
'try_out_plan_id' => 'integer',
'try_out_day' => 'integer',
// server
2020-01-05 02:23:26 +08:00
'server_token' => 'nullable|min:16',
2020-01-04 17:27:21 +08:00
// alipay
'alipay_enable' => 'in:0,1',
2020-01-05 02:16:41 +08:00
'alipay_appid' => 'nullable|integer|min:16',
2020-01-04 17:27:21 +08:00
'alipay_pubkey' => 'max:2048',
'alipay_privkey' => 'max:2048',
// stripe
'stripe_alipay_enable' => 'in:0,1',
'stripe_wepay_enable' => 'in:0,1',
2020-01-05 02:16:41 +08:00
'stripe_sk_live' => '',
'stripe_pk_live' => '',
'stripe_webhook_key' => '',
2020-01-04 17:27:21 +08:00
// bitpayx
'bitpayx_enable' => 'in:0,1',
2020-01-05 02:07:41 +08:00
'bitpayx_appsecret' => '',
2020-01-04 17:27:21 +08:00
// tutorial
2020-01-04 17:36:31 +08:00
'apple_id' => 'email',
'apple_id_password' => ''
2020-01-04 17:27:21 +08:00
];
2019-10-29 15:33:36 +08:00
public static function filter() {
2020-01-04 17:36:31 +08:00
// abort(500, json_encode(array_keys(self::RULES)));
2020-01-04 17:27:21 +08:00
return array_keys(self::RULES);
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
}
public function messages()
{
return [
];
}
}