Answer the question
In order to leave comments, you need to log in
How to update record in laravel with old value?
Hello.
I don’t find anything in the documentation other than banal examples, one that would show how to update a record by adding a new value to it. For example, there is an entry counter 10. I want to add 20 to it so that the total is 30.
If I write:
ModelName::where('id', 1)->update(['counter' => 20)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question