'col-md-6', ]; public function show() { Category::with('expense_transactions')->type('expense')->enabled()->each(function ($category) { $amount = 0; foreach ($category->expense_transactions as $transacion) { $amount += $transacion->getAmountConvertedToDefault(); } $this->addMoneyToDonut($category->color, $amount, $category->name); }); $chart = $this->getDonutChart(trans_choice('general.expenses', 2), 0, 160, 6); return view('widgets.expenses_by_category', [ 'config' => (object) $this->config, 'chart' => $chart, ]); } }