Reputation: 55
I need to update a column with keeping the current content in Laravel using eloquent. I am using the following code to update
$invoice = Invoice::find($request->input('session_cat_invoice'));
$invoice->note = $request->input('invoice_note');
$invoice->save();
column in DB before the update
test1
column in DB after the update using my code
test2
and that we I don't want, what I need is the following
test1 test2
Upvotes: 0
Views: 69
Reputation: 1971
try below code:
$invoice = Invoice::find($request->input('session_cat_invoice'));
$invoice->note = $invoice->note . ' ' . $request->input('invoice_note');
$invoice->save();
Upvotes: 1