With the help of update() function, we can update our data in the database according to the condition.

BY Best Interview Question ON 08 Apr 2019

Example

Blog::where(['id' => $id])->update([
   'title' => ’Best Interview Questions’,
   ‘content’ => ’Best Interview Questions’
]);

OR

DB::table("blogs")->where(['id' => $id])->update([
    'title' => ’Best Interview Questions’,
    ‘content’ => ’Best Interview Questions’
]);