To increase the value of the field laravel mysql?

DB::table('table')
 ->where('id', $id)
->update([
 'count' => \DB::raw('count + ?'),
 'updated_at' => now()
 ]);

If instead ? to put 1, then it works
And I need to increase the pitch in $count.
What to write instead ? ?
If so, it does not work
'count' => \DB::raw('count + ?', array($count)),
March 20th 20 at 11:19
1 answer
March 20th 20 at 11:21
Solution
https://laravel.com/docs/5.8/queries#increment-and...

'count' => \DB::raw('count + ?', array($count)),

everything that can be mixed in a heap.
so I suggested on toster - nikolas_Wilkinson commented on March 20th 20 at 11:24
@Marquis.Goodwin87, show me where you had suggested? - Timmothy.Rice commented on March 20th 20 at 11:27
@Lavad, How to specify the query mysql Update statement in php Laravel? - nikolas_Wilkinson commented on March 20th 20 at 11:30
@Marquis.Goodwin87specifically indicate where in the answers you suggested the design of the form 'count' => \DB::raw('count + ?', array($count)),? - Timmothy.Rice commented on March 20th 20 at 11:33

Find more questions by tags Laravel