AJAX将数据发送到控制器,如何更新正确的ID?

I am using ajax to post data to the controller and I need to update the record based on the id I pass through. How would I go about this with Laravel Eloquent? Here is the controller...I know the data is being passed to the controller correctly just don't know how to update based on the id I send. Thank you for your help.

public function home(Request $request) {

$updateCus = New Customer($request->all());
$updateCus->update()->where('id', $request['id']);

}

Correct syntax is:

Customer::where('id', $request->id)->update([
    'name' => $request->name,
    'country' => $request->country,
]);

Or, if you want to update many columns:

Customer::where('id', $request->id)->update($request->all());

If you want to update a record, you must fetch it from the database first. Instead, you're creating a new Customer. You should do something like this:

public function home(Request $request) {
    $customer = Customer::where('id', $request['id'])->first();
    if ($customer) {
        $customer->field1 = $request['field1'];
        //... update the fields you want to
        $customer->save();
    } else {
        //user not found...
    }
}
public function home(Request $request){
$id=$request->id;
$update=\DB:"table('tablename')->update(['columnname'=>$columname])->where('id',$id);
}