ConfigSave.php 1.8 KB

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