SysDataDictionaryRequest.php 918 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Http\Requests\Admin\Setting;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Http\Request;
  5. class SysDataDictionaryRequest 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(Request $request)
  22. {
  23. return [
  24. 'dic_key' => 'required',
  25. 'dic_value' => 'required',
  26. 'dic_name' => 'required',
  27. ];
  28. }
  29. public function messages()
  30. {
  31. return [
  32. 'dic_key.required' => '字典key不能为空',
  33. 'dic_value.required' => '字典value不能为空',
  34. 'dic_name.required' => '字典显示描述不能为空',
  35. ];
  36. }
  37. }