'required', 'username' => [ 'required', 'min:3', 'max:15', Rule::unique('users')->where(function (Builder $query) { return $query->where('deleted_at', null); })->ignore($this->route('id')) ], 'password' => 'nullable|min:5|max:15', 'phone' => [ 'nullable', Rule::unique('users')->where(function (Builder $query) { return $query->where('deleted_at', null); })->ignore($this->route('id')) ], 'telephone' => 'nullable', 'email' => 'nullable', 'status' => 'boolean', ]; } public function attributes() { return [ 'nickname' => '昵称', 'username' => '用户名', 'phone' => '手机号', 'password' => '密码', 'email' => '邮箱', 'role_id' => '角色', 'status' => '状态', 'sort' => '排序', 'site_id' => '站点', 'telephone' => '座机', ]; } }