if(Comments::create($data)){
$this->success('Comment posted successfully','index/index');
} else {
$this- >error('Comment saving failed','index/index');
}
I have created a unique index in the table. I want the commentator to only post a comment once, and the comment will be correct when sending it again. Previous comments updated and inserted. The above code can only implement insert into. Please help me implement replace into.