1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class AnnouncementRequest extends FormRequest
- {
- /**
- * Determine if the user is authorized to make this request.
- *
- * @return bool
- */
- public function authorize()
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules()
- {
- return [
- 'title' => 'required',
- 'description' => '',
- 'expiration_time' => 'required',
- 'area_id' => 'required',
- 'body' => 'required',
- 'status' => 'required',
- ];
- }
- public function attributes()
- {
- return [
- 'title' => '标题',
- 'expiration_time' => '过期时间',
- 'area_id' => '区域',
- 'body' => '公告内容',
- 'status' => '是否有效'
- ];
- }
- }
|