costUnits->getById($costUnitId); $estimates = $this->estimates->getEstimates($costUnit, $estimateType); return response()->json([ 'status' => 'success', 'costUnitId' => $costUnitId, 'title' => InvoiceType::where('slug', $estimateType)->first()->name, 'estimates' => $estimates, ]); } }