TableRequest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Http\Requests;
  3. use App\Http\Requests\Request;
  4. class TableRequest extends Request
  5. {
  6. /**
  7. * Determine if the user is authorized to make this request.
  8. *
  9. * @return bool
  10. */
  11. public function authorize()
  12. {
  13. return true;
  14. }
  15. /**
  16. * Get the validation rules that apply to the request.
  17. *
  18. * @return array
  19. */
  20. public function rules()
  21. {
  22. return [
  23. 'bzc_addr'=>'required',
  24. 'bzc_cardid'=>'required|numeric',
  25. 'bzc_name'=>'required',
  26. 'bzc_tel'=>'required|numeric',
  27. ];
  28. }
  29. public function messages()
  30. {
  31. return [
  32. 'bzc_addr.required'=>'被征收地址不能为空',
  33. 'bzc_cardid.required'=>'身份证不能为空',
  34. 'bzc_cardid.numeric'=>'身份证只能输入数字',
  35. 'bzc_name.required'=>'被征收人姓名必填',
  36. 'bzc_tel.required'=>'被征收人电话必填',
  37. 'bzc_tel.numeric'=>'被征收人电话只能输入数字',
  38. ];
  39. }
  40. }