ConfigSave.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_is_update' => '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. // abort(500, json_encode(array_keys(self::RULES)));
  43. return array_keys(self::RULES);
  44. }
  45. /**
  46. * Get the validation rules that apply to the request.
  47. *
  48. * @return array
  49. */
  50. public function rules()
  51. {
  52. return self::RULES;
  53. }
  54. public function messages()
  55. {
  56. return [
  57. ];
  58. }
  59. }