AnnouncementRequest.php 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class AnnouncementRequest 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. return [
  23. 'title' => 'required',
  24. 'description' => '',
  25. 'expiration_time' => 'required',
  26. 'area_id' => 'required',
  27. 'body' => 'required',
  28. 'status' => 'required',
  29. ];
  30. }
  31. public function attributes()
  32. {
  33. return [
  34. 'title' => '标题',
  35. 'expiration_time' => '过期时间',
  36. 'area_id' => '区域',
  37. 'body' => '公告内容',
  38. 'status' => '是否有效'
  39. ];
  40. }
  41. }