How I can update multiple objects with CONCAT in a single query?
The following code works, but it is not safe:
Table::whereIn('id', $idArray)->where('user_id', $this->userId)
->update([
'title' => DB::raw('CONCAT(title,'.$form->newPart.')')
]);
Another method that I have tried is the following, however it does not work:
Table::whereIn('id', $idArray)->where('user_id', $this->userId)
->update([
'title' => DB::raw('CONCAT(title,?)', [$form->newPart])
]);