LaborApplyRequest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Http\Requests\LaborApply;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Support\Facades\Auth;
  5. class LaborApplyRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. *
  10. * @return bool
  11. */
  12. public function authorize()
  13. {
  14. return true;
  15. }
  16. /**
  17. * Get the validation rules that apply to the request.
  18. *
  19. * @return array
  20. */
  21. public function rules()
  22. {
  23. return [
  24. 'warehouse_id' => 'required',
  25. 'user_workgroup_id' => 'required',
  26. 'man_num' => 'required',
  27. 'woman_num' => 'required',
  28. 'remark' => 'required',
  29. ];
  30. }
  31. public function messages()
  32. {
  33. return [
  34. 'warehouse_id.required' =>'不能为空。',
  35. 'user_workgroup_id.required' => '不能为空。',
  36. 'man_num.required' => '不能为空。',
  37. 'woman_num.required' => '不能为空。',
  38. 'remark.required' => '不能为空。',
  39. ];
  40. }
  41. }