Skip to content

Type DataBase

Query Builder


public function update(Request $request, $id)

$req = DB::table('users')
->where('id', $id)
->update([
'name' => $request->name,
'email' => $request->email,
'password' => bcrypt($request->password)
]);
return redirect('/dashboard');


Eloquent

// Eloquent
$user = User::find($id);
// dd($user);
$user->update($request->all());
return redirect('/user');
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.