ConfigSave.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. 'server_license' => 'nullable',
  24. // alipay
  25. 'alipay_enable' => 'in:0,1',
  26. 'alipay_appid' => 'nullable|integer|min:16',
  27. 'alipay_pubkey' => 'max:2048',
  28. 'alipay_privkey' => 'max:2048',
  29. // stripe
  30. 'stripe_alipay_enable' => 'in:0,1',
  31. 'stripe_wepay_enable' => 'in:0,1',
  32. 'stripe_sk_live' => '',
  33. 'stripe_pk_live' => '',
  34. 'stripe_webhook_key' => '',
  35. // bitpayx
  36. 'bitpayx_enable' => 'in:0,1',
  37. 'bitpayx_appsecret' => '',
  38. // paytaro
  39. 'paytaro_enable' => 'in:0,1',
  40. 'paytaro_app_id' => '',
  41. 'paytaro_app_secret' => '',
  42. // frontend
  43. 'frontend_theme' => 'in:1,2',
  44. 'frontend_background_url' => 'nullable|url',
  45. // tutorial
  46. 'apple_id' => 'email',
  47. 'apple_id_password' => '',
  48. // lab
  49. 'auth_type' => 'in:1,2',
  50. 'auth_salt' => ''
  51. ];
  52. public static function filter()
  53. {
  54. return array_keys(self::RULES);
  55. }
  56. /**
  57. * Get the validation rules that apply to the request.
  58. *
  59. * @return array
  60. */
  61. public function rules()
  62. {
  63. return self::RULES;
  64. }
  65. public function messages()
  66. {
  67. return [
  68. ];
  69. }
  70. }