1.

How to use update query in Laravel?

Answer»

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

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’
]);



Discussion

No Comment Found