ConfigSave.php 1.9 KB

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