OrderAssign.php 893 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Http\Requests\Admin;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class OrderAssign extends FormRequest
  5. {
  6. /**
  7. * Get the validation rules that apply to the request.
  8. *
  9. * @return array
  10. */
  11. public function rules()
  12. {
  13. return [
  14. 'plan_id' => 'required',
  15. 'email' => 'required',
  16. 'total_amount' => 'required',
  17. 'cycle' => 'required|in:month_price,quarter_price,half_year_price,year_price,onetime_price,reset_price'
  18. ];
  19. }
  20. public function messages()
  21. {
  22. return [
  23. 'plan_id.required' => '订阅不能为空',
  24. 'email.required' => '邮箱不能为空',
  25. 'total_amount.required' => '支付金额不能为空',
  26. 'cycle.required' => '订阅周期不能为空',
  27. 'cycle.in' => '订阅周期格式有误'
  28. ];
  29. }
  30. }