#### I can’t find the user and sum

i have a problem, i need to add the debt of a user

controller:

 public function cliente($id){ //$nota = AppNota::find($id); //Aquí valida si existe sino redirije al 404$datos = [
'category_name' => 'datatable',
'page_name' => 'multiple_tables',
'registro' => Registro::find($id), ];$cliente = AppModelsUser::findOrFail($id); return view('cliente', compact('cliente'))->with($datos);
}


<div class="row">
<div class="col">
<h4>Debt Sum:</h4>
</div>
<div class="col">
{{ \$registro->user_id->sum('deuda') }}
</div>


Database:

i need to add the field "deuda" of the user, the relationship is in user_id with the users table

the error that I get is: Trying to get property ‘user_id’ of non-object

help pls

Source: Laravel