想问问大家这种的写法能优雅一些嘛 =。= ,感觉好丑啊...
$comment = Comment::find($request->id);
$comment->update(['status' => 1]);
Comment::where('commentable_id',$comment->commentable_id)->where('id','!=',$comment->id)->update(['status' => 0]);
想问问大家这种的写法能优雅一些嘛 =。= ,感觉好丑啊...
$comment = Comment::find($request->id);
$comment->update(['status' => 1]);
Comment::where('commentable_id',$comment->commentable_id)->where('id','!=',$comment->id)->update(['status' => 0]);