LadingBillSaveRequest.php 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Http\Requests;
  3. class LadingBillSaveRequest extends Request
  4. {
  5. /**
  6. * Determine if the user is authorized to make this request.
  7. *
  8. * @return bool
  9. */
  10. public function authorize()
  11. {
  12. return true;
  13. }
  14. /**
  15. * Get the validation rules that apply to the request.
  16. *
  17. * @return array
  18. */
  19. public function rules()
  20. {
  21. if (!$this->ajax()) {
  22. return [];
  23. }
  24. return [
  25. 'title' => 'required',
  26. 'site_id' => 'required',
  27. 'amount' => 'required',
  28. 'contract_file' => 'required|array',
  29. 'remark' => 'nullable',
  30. ];
  31. }
  32. public function attributes()
  33. {
  34. return [
  35. 'title' => '提单名称',
  36. 'amount' => '金额',
  37. 'site_id' => '关联站点',
  38. 'contract_file' => '合同文件',
  39. 'remark' => '备注',
  40. ];
  41. }
  42. }