ConfigSave.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace App\Http\Requests\Admin;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class ConfigSave extends FormRequest
  5. {
  6. CONST RULES = [
  7. 'invite_force' => 'in:0,1',
  8. 'invite_commission' => 'integer',
  9. 'invite_gen_limit' => 'integer',
  10. 'invite_never_expire' => 'in:0,1',
  11. 'stop_register' => 'in:0,1',
  12. 'email_verify' => 'in:0,1',
  13. 'app_name' => '',
  14. 'app_url' => 'url',
  15. 'subscribe_url' => 'url',
  16. 'plan_transfer_hour' => 'numeric',
  17. 'plan_change_enable' => 'in:0,1',
  18. 'try_out_enable' => 'in:0,1',
  19. 'try_out_plan_id' => 'integer',
  20. 'try_out_hour' => 'numeric',
  21. // server
  22. 'server_token' => 'nullable|min:16',
  23. 'server_license' => 'nullable',
  24. // alipay
  25. 'alipay_enable' => 'in:0,1',
  26. 'alipay_appid' => 'nullable|integer|min:16',
  27. 'alipay_pubkey' => 'max:2048',
  28. 'alipay_privkey' => 'max:2048',
  29. // stripe
  30. 'stripe_alipay_enable' => 'in:0,1',
  31. 'stripe_wepay_enable' => 'in:0,1',
  32. 'stripe_sk_live' => '',
  33. 'stripe_pk_live' => '',
  34. 'stripe_webhook_key' => '',
  35. // bitpayx
  36. 'bitpayx_enable' => 'in:0,1',
  37. 'bitpayx_appsecret' => '',
  38. // paytaro
  39. 'paytaro_enable' => 'in:0,1',
  40. 'paytaro_app_id' => '',
  41. 'paytaro_app_secret' => '',
  42. // tutorial
  43. 'apple_id' => 'email',
  44. 'apple_id_password' => ''
  45. ];
  46. public static function filter()
  47. {
  48. // abort(500, json_encode(array_keys(self::RULES)));
  49. return array_keys(self::RULES);
  50. }
  51. /**
  52. * Get the validation rules that apply to the request.
  53. *
  54. * @return array
  55. */
  56. public function rules()
  57. {
  58. return self::RULES;
  59. }
  60. public function messages()
  61. {
  62. return [
  63. ];
  64. }
  65. }