使用Raw,如何返回更新行的集合?
例如:
$updated = DB::table('users')->where('id', 1)->update(['votes' => 123]);
我期待 dd($updated)
返回更新的集合行,但它返回了 1。
{{$updated->votes}} should return 123
最佳答案
试试这个
$updated = tap(DB::table('users')->where('id', 1))
->update(['votes' => 123])
->first();
关于php - 更新后返回集合()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43093965/