Answers for "mass update based on condition for specific column laravel"

PHP
0

laravel update single field

User::where('id', '=', $id)->update(['name' => $request->name]);
Posted by: Guest on July-12-2021
0

update onlu one column laravel

Page::where('id', $id)->update(array('image' => 'asdasd'));

// -----or-----

$page = Page::findOrFail($id);
// Make sure you've got the Page model
if($page) {
    $page->image = 'imagepath';
    $page->save();
}
Posted by: Guest on March-04-2021

Code answers related to "mass update based on condition for specific column laravel"

Browse Popular Code Answers by Language