laravel 语句优化

想问问大家这种的写法能优雅一些嘛 =。= ,感觉好丑啊...

$comment = Comment::find($request->id);

$comment->update(['status' => 1]);

Comment::where('commentable_id',$comment->commentable_id)->where('id','!=',$comment->id)->update(['status' => 0]);
dope2008

想不到呀。

$comment = Comment::find($request->id);

$comment->update(['status' => 1]);

这个好象执行了二条SQL吧,,,一条select 一条update

还不如

Comment::where('id',$request->id)->update(['status' => 1]);
UncleCaozy 回复 dope2008

他有两个条件