ConfigSave.php 2.0 KB

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