ConfigSave.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_update_fee' => 'numeric',
  17. 'plan_is_update' => 'in:0,1',
  18. 'try_out_enable' => 'in:0,1',
  19. 'try_out_plan_id' => 'integer',
  20. 'try_out_day' => 'integer',
  21. // server
  22. 'server_token' => 'min:16',
  23. // alipay
  24. 'alipay_enable' => 'in:0,1',
  25. 'alipay_appid' => '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. // bitpayx
  32. 'bitpayx_enable' => 'in:0,1',
  33. // tutorial
  34. 'apple_id' => 'email',
  35. 'apple_id_password' => ''
  36. ];
  37. public static function filter() {
  38. // abort(500, json_encode(array_keys(self::RULES)));
  39. return array_keys(self::RULES);
  40. }
  41. /**
  42. * Get the validation rules that apply to the request.
  43. *
  44. * @return array
  45. */
  46. public function rules()
  47. {
  48. return self::RULES;
  49. }
  50. public function messages()
  51. {
  52. return [
  53. ];
  54. }
  55. }