Reputation: 578
I need to update a field value by one and I have done this:
UserTestOption::where('user_id', Auth::id())->update(['done' => 'done'+1]);
but it's not updating the field's value
Upvotes: 0
Views: 37
Reputation: 8750
You could use increment.
UserTestOption::where('user_id', Auth::id()) ->increment('done');
Upvotes: 4