diff --git a/app/Services/Analytics/Export/AnalyticsPdfExport.php b/app/Services/Analytics/Export/AnalyticsPdfExport.php new file mode 100644 index 0000000..d56b5ca --- /dev/null +++ b/app/Services/Analytics/Export/AnalyticsPdfExport.php @@ -0,0 +1,20 @@ + $title, + 'columns' => array_map(fn ($c) => $c->toArray(), $result->columns), + 'rows' => $result->rows, + 'generatedAt' => now('Asia/Yakutsk')->format('d.m.Y H:i'), + ])->setPaper('a4', 'landscape'); + } +} diff --git a/resources/views/reports/analytics_pdf.blade.php b/resources/views/reports/analytics_pdf.blade.php new file mode 100644 index 0000000..a2ec253 --- /dev/null +++ b/resources/views/reports/analytics_pdf.blade.php @@ -0,0 +1,43 @@ + + +
+ +Сформирован {{ $generatedAt }}
+ + @if (empty($rows)) +Нет данных за выбранный период.
+ @else +| {{ $column['label'] }} | + @endforeach +
|---|
| {{ $row[$column['key']] ?? '' }} | + @endforeach +