BoxBindingRequest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class BoxBindingRequest extends FormRequest
  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. $id = (int)optional($this->route('box'))->id;
  23. return [
  24. //
  25. // 'box_no' => 'required|unique:box_binding,box_no,' . $id,
  26. 'box_no' => 'required',
  27. 'batch' => 'required',
  28. 'device_xing' => 'required',
  29. 'manufacturer' => 'required',
  30. 'bluetooth_token' => '',
  31. 'bluetooth_mac' => '',
  32. 'imei_no' => '',
  33. 'iccid_no' => '',
  34. 'sim_no' => '',
  35. 'imsi_no' => '',
  36. 'mold' => 'required',
  37. 'merchant_id' => ''
  38. ];
  39. }
  40. public function attributes()
  41. {
  42. return [
  43. 'batch' => '批次',
  44. 'box_no' => '控制设备编号',
  45. 'device_xing' => '中控型号',
  46. 'manufacturer' => '厂商',
  47. 'mold' => '控制器型号'
  48. ];
  49. }
  50. }