ConfigSave.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. // alipay
  24. 'alipay_enable' => 'in:0,1',
  25. 'alipay_appid' => 'nullable|integer|min:16',
  26. 'alipay_pubkey' => 'max:2048',
  27. 'alipay_privkey' => 'max:2048',
  28. // stripe
  29. 'stripe_alipay_enable' => 'in:0,1',
  30. 'stripe_wepay_enable' => 'in:0,1',
  31. 'stripe_sk_live' => '',
  32. 'stripe_pk_live' => '',
  33. 'stripe_webhook_key' => '',
  34. // bitpayx
  35. 'bitpayx_enable' => 'in:0,1',
  36. 'bitpayx_appsecret' => '',
  37. // tutorial
  38. 'apple_id' => 'email',
  39. 'apple_id_password' => ''
  40. ];
  41. public static function filter()
  42. {
  43. // abort(500, json_encode(array_keys(self::RULES)));
  44. return array_keys(self::RULES);
  45. }
  46. /**
  47. * Get the validation rules that apply to the request.
  48. *
  49. * @return array
  50. */
  51. public function rules()
  52. {
  53. return self::RULES;
  54. }
  55. public function messages()
  56. {
  57. return [
  58. ];
  59. }
  60. }