How to Increment Multiple Fields in Laravel
In this lesson, we will see how to increment multiple fields in Laravel, in the old versions of laravel you could increment only one field but since version 9.48 you can increment multiple fields with only one query.
How to increment multiple fields in Laravel
You can do that using the code below:
Post::find(1)->incrementEach([
'likes' => 1,
'views' => 1
]);