ConfigSave.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace App\Http\Requests\Admin;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class ConfigSave extends FormRequest
  5. {
  6. CONST RULES = [
  7. 'save_mode' => '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. // server
  23. 'server_token' => 'nullable|min:16',
  24. 'server_license' => 'nullable',
  25. // alipay
  26. 'alipay_enable' => 'in:0,1',
  27. 'alipay_appid' => 'nullable|integer|min:16',
  28. 'alipay_pubkey' => 'max:2048',
  29. 'alipay_privkey' => 'max:2048',
  30. // stripe
  31. 'stripe_alipay_enable' => 'in:0,1',
  32. 'stripe_wepay_enable' => 'in:0,1',
  33. 'stripe_sk_live' => '',
  34. 'stripe_pk_live' => '',
  35. 'stripe_webhook_key' => '',
  36. // bitpayx
  37. 'bitpayx_enable' => 'in:0,1',
  38. 'bitpayx_appsecret' => '',
  39. // paytaro
  40. 'paytaro_enable' => 'in:0,1',
  41. 'paytaro_app_id' => '',
  42. 'paytaro_app_secret' => '',
  43. // frontend
  44. 'frontend_theme' => 'in:1,2',
  45. 'frontend_background_url' => 'nullable|url',
  46. // tutorial
  47. 'apple_id' => 'email',
  48. 'apple_id_password' => ''
  49. ];
  50. public static function filter()
  51. {
  52. return array_keys(self::RULES);
  53. }
  54. /**
  55. * Get the validation rules that apply to the request.
  56. *
  57. * @return array
  58. */
  59. public function rules()
  60. {
  61. return self::RULES;
  62. }
  63. public function messages()
  64. {
  65. return [
  66. ];
  67. }
  68. }