ConfigSave.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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_upgrade_fee',
  18. 'plan_is_upgrade',
  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. // server
  54. 'server_token' => 'min:16',
  55. // alipay
  56. 'alipay_enable' => 'in:0,1',
  57. 'alipay_appid' => 'integer|min:16',
  58. 'alipay_pubkey' => 'max:2048',
  59. 'alipay_privkey' => 'max:2048',
  60. // stripe
  61. 'stripe_alipay_enable' => 'in:0,1',
  62. 'stripe_wepay_enable' => 'in:0,1',
  63. // tutorial
  64. 'apple_id' => 'email'
  65. ];
  66. }
  67. public function messages()
  68. {
  69. return [
  70. ];
  71. }
  72. }