Answers for "eloquent update one field"

PHP
0

laravel update single field

User::where('id', '=', $id)->update(['name' => $request->name]);
Posted by: Guest on July-12-2021
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

Browse Popular Code Answers by Language