ConfigSave.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace App\Http\Requests\Admin;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class ConfigSave extends FormRequest
  5. {
  6. CONST RULES = [
  7. 'invite_force' => 'in:0,1',
  8. 'invite_commission' => 'integer',
  9. 'invite_gen_limit' => 'integer',
  10. 'invite_never_expire' => 'in:0,1',
  11. 'stop_register' => 'in:0,1',
  12. 'email_verify' => 'in:0,1',
  13. 'app_name' => '',
  14. 'app_url' => 'url',
  15. 'subscribe_url' => 'url',
  16. 'plan_transfer_hour' => 'numeric',
  17. 'plan_change_enable' => 'in:0,1',
  18. 'try_out_enable' => 'in:0,1',
  19. 'try_out_plan_id' => 'integer',
  20. 'try_out_hour' => 'numeric',
  21. // server
  22. 'server_token' => 'nullable|min:16',
  23. // alipay
  24. 'alipay_enable' => 'in:0,1',
  25. 'alipay_appid' => 'nullable|integer|min:16',
  26. 'alipay_pubkey' => 'max:2048',
  27. 'alipay_privkey' => 'max:2048',
  28. // stripe
  29. 'stripe_alipay_enable' => 'in:0,1',
  30. 'stripe_wepay_enable' => 'in:0,1',
  31. 'stripe_sk_live' => '',
  32. 'stripe_pk_live' => '',
  33. 'stripe_webhook_key' => '',
  34. // bitpayx
  35. 'bitpayx_enable' => 'in:0,1',
  36. 'bitpayx_appsecret' => '',
  37. // paytaro
  38. 'paytaro_enable' => 'in:0,1',
  39. 'paytaro_app_id' => '',
  40. 'paytaro_app_secret' => '',
  41. // tutorial
  42. 'apple_id' => 'email',
  43. 'apple_id_password' => ''
  44. ];
  45. public static function filter()
  46. {
  47. // abort(500, json_encode(array_keys(self::RULES)));
  48. return array_keys(self::RULES);
  49. }
  50. /**
  51. * Get the validation rules that apply to the request.
  52. *
  53. * @return array
  54. */
  55. public function rules()
  56. {
  57. return self::RULES;
  58. }
  59. public function messages()
  60. {
  61. return [
  62. ];
  63. }
  64. }