企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
# 更新 ## 更新数据表中的数据 ``` DB::table('users') ->where('id', 1) ->update(['votes' => 1]); ``` ## 自增或自减一个字段的值 ``` DB::table('users')->increment('votes'); DB::table('users')->increment('votes', 5); DB::table('users')->decrement('votes'); DB::table('users')->decrement('votes', 5); ``` 也能够同时指定其他要更新的字段: ``` DB::table('users')->increment('votes', 1, ['name' => 'John']); ```