ConfigSave.php 1.6 KB

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