public function confirmBudget($id) { $budget = Budget::find($id); $budget->status = "Confirmado"; $budget->save(); $today = date("Y-m-d"); $dataDebt = ['total' => $budget->total, 'patient_id' => $budget->Patient->id, 'budget_id' => $budget->id, 'date' => $today]; $debt = new Debt($dataDebt); $debt->save(); return "Actualizado"; }
public function index() { return Debt::with('user')->get(); }