ConfigSave.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_nerver_expire',
  12. 'stop_register',
  13. 'email_verify',
  14. 'app_name',
  15. 'app_url',
  16. 'server_token',
  17. // alipay
  18. 'alipay_enable',
  19. 'alipay_appid',
  20. 'alipay_pubkey',
  21. 'alipay_privkey',
  22. // stripe
  23. 'stripe_sk_live',
  24. 'stripe_pk_live',
  25. 'stripe_alipay_enable',
  26. 'stripe_wepay_enable',
  27. 'stripe_webhook_key'
  28. ];
  29. }
  30. /**
  31. * Get the validation rules that apply to the request.
  32. *
  33. * @return array
  34. */
  35. public function rules()
  36. {
  37. return [
  38. 'invite_force' => 'in:0,1',
  39. 'invite_commission' => 'integer',
  40. 'invite_gen_limit' => 'integer',
  41. 'invite_nerver_expire' => 'in:0,1',
  42. 'stop_register' => 'in:0,1',
  43. 'email_verify' => 'in:0,1',
  44. 'server_token' => 'min:16',
  45. 'app_url' => 'url',
  46. // alipay
  47. 'alipay_enable' => 'in:0,1',
  48. 'alipay_appid' => 'integer|min:16',
  49. 'alipay_pubkey' => 'max:2048',
  50. 'alipay_privkey' => 'max:2048',
  51. // stripe
  52. 'stripe_alipay_enable' => 'in:0,1',
  53. 'stripe_wepay_enable' => 'in:0,1'
  54. ];
  55. }
  56. public function messages()
  57. {
  58. return [
  59. ];
  60. }
  61. }