ajax()) { return []; } return [ 'profile_img' => 'nullable', 'nickname' => 'nullable', 'username' => [ 'required', 'min:3', 'max:15', Rule::unique('users')->where(function (Builder $query) { return $query->where('deleted_at', null); })->ignore($this->input('id')) ], 'phone' => [ 'required', Rule::unique('users')->where(function (Builder $query) { return $query->where('deleted_at', null); })->ignore($this->input('id')) ], 'password' => 'nullable|min:5|max:15', 'entry_time'=>'nullable', 'email' => 'email', 'qq'=>'nullable', 'telephone'=>'nullable', 'intro'=>'nullable', ]; } public function attributes() { return [ 'nickname' => '昵称', 'profile_img' => '头像', 'username' => '用户名', 'phone' => '手机号', 'password' => '密码', 'email' => '邮箱', 'qq'=>'qq号', 'telephone'=>'座机' ]; } }