У меня есть этот код, я получаю здесь все, что хочу, но все идет в атрибут, но я не знаю, как я могу получить доступ к своим элементам отчета в атрибутах этих массивов?

$reportsGrouped = Collect($pharmacy->pharmacyReportIndetificator->reportItem->map(function($item){ вернуть $item->отчет; }))->unique('report_id')->map(function($report) use($pharmacy) { $reportItems = ReportItem::where(['report_id' => $report->report_id, 'report_pharmacy_pib_code' => $pharmacy->pharmacyReportIndetificator->pharmacy_pib])->get(); $reportItemsSum = $reportItems->sum('report_product_sum'); $report->reportItemsSum = $reportItemsSum; $report->reportItems = $reportItems; вернуть $отчет; })->sortBy('report_date')->groupBy('report_date');
Мобильная версия