ConfigSave.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. // tutorial
  33. 'apple_id',
  34. 'apple_id_password'
  35. ];
  36. }
  37. /**
  38. * Get the validation rules that apply to the request.
  39. *
  40. * @return array
  41. */
  42. public function rules()
  43. {
  44. return [
  45. 'invite_force' => 'in:0,1',
  46. 'invite_commission' => 'integer',
  47. 'invite_gen_limit' => 'integer',
  48. 'invite_never_expire' => 'in:0,1',
  49. 'stop_register' => 'in:0,1',
  50. 'email_verify' => 'in:0,1',
  51. 'app_url' => 'url',
  52. 'subscribe_url' => 'url',
  53. 'plan_update_fee' => 'numeric',
  54. 'plan_is_update' => 'in:0,1',
  55. // server
  56. 'server_token' => 'min:16',
  57. // alipay
  58. 'alipay_enable' => 'in:0,1',
  59. 'alipay_appid' => 'integer|min:16',
  60. 'alipay_pubkey' => 'max:2048',
  61. 'alipay_privkey' => 'max:2048',
  62. // stripe
  63. 'stripe_alipay_enable' => 'in:0,1',
  64. 'stripe_wepay_enable' => 'in:0,1',
  65. // tutorial
  66. 'apple_id' => 'email'
  67. ];
  68. }
  69. public function messages()
  70. {
  71. return [
  72. ];
  73. }
  74. }