1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Http\Requests;
- use App\Http\Requests\Request;
- class UserRequest extends Request
- {
- /**
- * 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 [
- 'name'=>'required',
- 'pswd'=>'required',
- 'surname'=>'required',
- 'role_id'=>'required',
- 'department_id'=>'required',
- ];
- }
- public function messages()
- {
- return[
- 'name.required'=>'登录名不能为空',
- 'pswd.required'=>'密码不能为空',
- 'surname.required'=>'姓名不能为空',
- 'role_id.required'=>'职位不能为空',
- 'department_id.required'=>'单位机构不能为空',
- ];
- }
- }
|