Answers for "update one field laravel"

PHP
12

update column value laravel

Page::where('id', $id)->update(array('image' => 'asdasd'));
Posted by: Guest on May-07-2020
0

laravel update single field

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

update column value laravel

$page = Page::find($id);

// Make sure you've got the Page model
if($page) {
    $page->image = 'imagepath';
    $page->save();
}
Posted by: Guest on May-07-2020
0

update only update_at field on laravel eloquent

//instead of
$user->updated_at = DB::raw('NOW()');
$user->save();

// simply this:
$user->touch();
Posted by: Guest on August-26-2021

Code answers related to "update one field laravel"

Browse Popular Code Answers by Language