ConfigSave.php 2.2 KB

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