MailSend.php 799 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Http\Requests\Admin;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class MailSend 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. 'type' => 'required|in:1,2',
  15. 'subject' => 'required',
  16. 'content' => 'required',
  17. 'receiver' => 'array'
  18. ];
  19. }
  20. public function messages()
  21. {
  22. return [
  23. 'type.required' => '发送类型不能为空',
  24. 'type.in' => '发送类型格式有误',
  25. 'subject.required' => '主题不能为空',
  26. 'content.required' => '内容不能为空',
  27. 'receiver.array' => '收件人格式有误'
  28. ];
  29. }
  30. }